mirror of
https://github.com/maubot/maubot.git
synced 2024-10-01 01:06:10 -04:00
Fix patching instances
This commit is contained in:
parent
f5886ed34b
commit
982623b677
@ -170,6 +170,8 @@ class PluginInstance:
|
||||
self.plugin.on_external_config_update()
|
||||
|
||||
async def update_primary_user(self, primary_user: UserID) -> bool:
|
||||
if not primary_user or primary_user == self.primary_user:
|
||||
return True
|
||||
client = Client.get(primary_user)
|
||||
if not client:
|
||||
return False
|
||||
|
@ -65,7 +65,7 @@ async def _create_instance(instance_id: str, data: dict) -> web.Response:
|
||||
|
||||
|
||||
async def _update_instance(instance: PluginInstance, data: dict) -> web.Response:
|
||||
if not await instance.update_primary_user(data.get("primary_user")):
|
||||
if not await instance.update_primary_user(data.get("primary_user", None)):
|
||||
return ErrPrimaryUserNotFound
|
||||
instance.update_id(data.get("id", None))
|
||||
instance.update_enabled(data.get("enabled", None))
|
||||
|
Loading…
Reference in New Issue
Block a user