mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-19 07:06:30 +00:00
Fix error on save special permission (#1145)
This commit is contained in:
parent
157740e374
commit
0a34f427f8
@ -291,7 +291,7 @@ class APIAddons(CoreSysAttributes):
|
||||
_LOGGER.warning("Protected flag changing for %s!", addon.slug)
|
||||
addon.protected = body[ATTR_PROTECTED]
|
||||
|
||||
addon.save_data()
|
||||
addon.save_persist()
|
||||
|
||||
@api_process
|
||||
async def stats(self, request: web.Request) -> Dict[str, Any]:
|
||||
|
@ -96,8 +96,6 @@ class Ingress(JsonConfig, CoreSysAttributes):
|
||||
valid = utcnow() + timedelta(minutes=15)
|
||||
|
||||
self.sessions[session] = valid.timestamp()
|
||||
self.save_data()
|
||||
|
||||
return session
|
||||
|
||||
def validate_session(self, session: str) -> bool:
|
||||
|
@ -9,7 +9,6 @@ def test_session_handling(coresys):
|
||||
session = coresys.ingress.create_session()
|
||||
validate = coresys.ingress.sessions[session]
|
||||
|
||||
assert coresys.ingress.save_data.called
|
||||
assert session
|
||||
assert validate
|
||||
|
||||
@ -22,6 +21,14 @@ def test_session_handling(coresys):
|
||||
assert not coresys.ingress.validate_session("invalid session")
|
||||
|
||||
|
||||
async def test_save_on_unload(coresys):
|
||||
"""Test called save on unload."""
|
||||
coresys.ingress.create_session()
|
||||
await coresys.ingress.unload()
|
||||
|
||||
assert coresys.ingress.save_data.called
|
||||
|
||||
|
||||
def test_dynamic_ports(coresys):
|
||||
"""Test dyanmic port handling."""
|
||||
port_test1 = coresys.ingress.get_dynamic_port("test1")
|
||||
|
Loading…
x
Reference in New Issue
Block a user