mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-30 22:29:32 +00:00
"Finish" the accounting views
This commit is contained in:
1 parent
9c0b17a9ae
commit
6e05207e84
13 files changed
+191
-16
No files matched your search
+3
-1
@@ -266,7 +266,9 @@ class AnonymousUser(AuthAnonymousUser):
|
||||
return False
|
||||
|
||||
def can_view(self, obj):
|
||||
if obj.view_groups.filter(pk=settings.SITH_GROUPS['public']['id']).exists():
|
||||
if hasattr(obj, 'view_groups') and obj.view_groups.filter(pk=settings.SITH_GROUPS['public']['id']).exists():
|
||||
return True
|
||||
if hasattr(obj, 'can_be_viewed_by') and obj.can_be_viewed_by(self):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in new issue
Block a user