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
96356d3f
Verified
Commit
96356d3f
authored
Sep 20, 2018
by
Sébastiaan Versteeg
Browse files
Prevent editing of completed registrations
parent
c77b1407
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/registrations/admin.py
View file @
96356d3f
...
...
@@ -102,7 +102,8 @@ class RegistrationAdmin(admin.ModelAdmin):
def
get_readonly_fields
(
self
,
request
,
obj
=
None
):
if
obj
is
None
or
not
(
obj
.
status
==
Entry
.
STATUS_REJECTED
or
obj
.
status
==
Entry
.
STATUS_ACCEPTED
):
obj
.
status
==
Entry
.
STATUS_ACCEPTED
or
obj
.
status
==
Entry
.
STATUS_COMPLETED
):
return
[
'status'
,
'created_at'
,
'updated_at'
]
else
:
return
[
field
.
name
for
field
in
self
.
model
.
_meta
.
get_fields
()
...
...
Write
Preview
Markdown
is supported
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