Skip to content

Commit

Permalink
test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
odenypeter committed Sep 12, 2024
1 parent 5a77150 commit 03c6458
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ class Meta:
def get_subscriptions(self, organization):
# check if user is OrgAdmin
if self.context.get('request') and hasattr(self.context.get('request'), 'user'):
user_groups = self.context.get('request').user.core_groups.values_list('name', flat=True)
try:
user_groups = self.context.get('request').user.core_groups.values_list('name', flat=True)
except AttributeError:
user_groups = []
if ROLE_ORGANIZATION_ADMIN in user_groups:
return SubscriptionSerializer(
organization.organization_subscription.all(),
Expand Down

0 comments on commit 03c6458

Please sign in to comment.