Commit 59b4bfe9 authored by Luko van der Maas's avatar Luko van der Maas
Browse files

Merge branch 'tc/prepopulated-field-property' into 'master'

Move prepopulated fields back to original implementation

See merge request !1104
parents 3f1c1dc0 0f8b6278
This diff is collapsed.
......@@ -120,6 +120,7 @@ class EventAdmin(DoNextModelAdmin):
actions = ('make_published', 'make_unpublished')
date_hierarchy = 'start'
search_fields = ('title', 'description')
prepopulated_fields = {'map_location': ('location',)}
def overview_link(self, obj):
return format_html('<a href="{link}">{title}</a>',
......@@ -231,14 +232,6 @@ class EventAdmin(DoNextModelAdmin):
del actions['delete_selected']
return actions
def get_prepopulated_fields(self, request, obj):
# FIXME(Django bug) move this back to a normal ``prepopulated_fields``
# class field when bug gets
# fixed
if self.has_change_permission(request, obj):
return {'map_location': (f'location_en',)}
return super().get_prepopulated_fields(request, obj)
def get_formsets_with_inlines(self, request, obj=None):
for inline in self.get_inline_instances(request, obj):
if self.has_change_permission(request, obj) or obj is None:
Supports Markdown
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