# HG changeset patch # User Goffi # Date 1652616924 -7200 # Node ID 7b90d7c474fa2c67d07c1a6cf25008fe2f9c73bf # Parent 001ea5f4a2f99529625d73e2d9ea42deec09c197 comp file sharing: handle `admins` in quotas diff -r 001ea5f4a2f9 -r 7b90d7c474fa sat/plugins/plugin_comp_file_sharing.py --- a/sat/plugins/plugin_comp_file_sharing.py Sun May 15 14:14:52 2022 +0200 +++ b/sat/plugins/plugin_comp_file_sharing.py Sun May 15 14:15:24 2022 +0200 @@ -410,13 +410,14 @@ def getQuota(self, client, entity): """Return maximum size allowed for all files for entity""" - # TODO: handle special entities like admins quotas = self.host.memory.getConfig("component file-sharing", "quotas_json", {}) - entity_bare_s = entity.userhost() - try: - quota = quotas["jids"][entity_bare_s] - except KeyError: - quota = quotas.get("users") + if self.host.memory.isAdminJID(entity): + quota = quotas.get("admins") + else: + try: + quota = quotas["jids"][entity.userhost()] + except KeyError: + quota = quotas.get("users") return None if quota is None else utils.parseSize(quota) async def generate_thumbnails(self, extra: dict, image_path: Path):