Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
0f8b6278
Verified
Commit
0f8b6278
authored
Dec 16, 2018
by
Sébastiaan Versteeg
Browse files
Move prepopulated fields back to original implementation
parent
54be451b
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Pipfile.lock
View file @
0f8b6278
This diff is collapsed.
Click to expand it.
website/events/admin.py
View file @
0f8b6278
...
...
@@ -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 https://code.djangoproject.com/ticket/29929 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
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment