diff options
-rw-r--r-- | archaeological_files/models.py | 6 | ||||
-rw-r--r-- | ishtar_common/models.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 6a6da0e57..04a723b82 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -224,9 +224,9 @@ class File(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem): @classmethod def get_owns(cls, user): - owns = list(super(File, cls).get_owns(user)) - return sorted(owns, key=lambda x:(x.has_adminact, - x.delay_date)) + owns = super(File, cls).get_owns(user) + return sorted(owns.all(), key=lambda x:(x.has_adminact, + x.delay_date)) @classmethod def get_years(cls): diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 9eba9ccd0..5c6e208d7 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -189,10 +189,10 @@ class OwnPerms: if isinstance(user, User): user = IshtarUser.objects.get(user_ptr=user) if user.is_anonymous(): - return [] + return cls.objects.filter(pk__isnull=True) query = cls.get_query_owns(user) if not query: - return [] + return cls.objects.filter(pk__isnull=True) return cls.objects.filter(query).order_by(*cls._meta.ordering) class GeneralType(models.Model): |