Commit 13441dbf authored by okhin's avatar okhin 🚴

Fixing the formfield function in case of superuser.

parent c3984fb3
Pipeline #1239 passed with stage
in 54 seconds
......@@ -32,6 +32,9 @@ class CampaignAdmin(TranslationAdmin):
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if == "organization":
if request.user.is_superuser:
kwargs["queryset"] = Organization.objects.all()
query = {'id__in': [
for x in request.user.organizations.all()]}
kwargs["queryset"] = Organization.objects.filter(**query)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment