add manual account override for when unauthenticated users call the auth endpoint.
This commit is contained in:
parent
6ec9065f8e
commit
0c98606234
@ -98,6 +98,9 @@ class ConnectionViewSet(viewsets.ModelViewSet):
|
||||
user = request.user
|
||||
# Filter out any accounts with the right id, but the given user
|
||||
# is not an owner or admin on that account.
|
||||
if request.user.is_anonymous():
|
||||
accounts = (Account.objects.filter(pk=1))
|
||||
else:
|
||||
accounts = (Account.objects.filter(pk=account_id, owner=user) |
|
||||
Account.objects.filter(pk=account_id,
|
||||
admin_users__in=[user]))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user