Skip to content

Commit

Permalink
♻️ Allow adding/editing of FeedItemData via admin if DEBUG is true
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Feb 29, 2024
1 parent 9bcf61c commit 6d67846
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/open_inwoner/userfeed/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.conf import settings
from django.contrib import admin

from .models import FeedItemData
Expand Down Expand Up @@ -27,7 +28,10 @@ class FeedItemDataAdmin(admin.ModelAdmin):
]

def has_change_permission(self, request, obj=None):
if settings.DEBUG:
return super().has_change_permission(request, obj=obj)
return False

def has_add_permission(self, request):
pass
if settings.DEBUG:
return super().has_add_permission(request)

0 comments on commit 6d67846

Please sign in to comment.