Skip to content
GitLab
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
ae817a24
Commit
ae817a24
authored
Sep 11, 2016
by
Sébastiaan Versteeg
Browse files
Disable board name in adminform
parent
9671bb86
Changes
2
Hide whitespace changes
Inline
Side-by-side
website/activemembers/admin.py
View file @
ae817a24
...
...
@@ -3,6 +3,7 @@ from utils.translation import TranslatedModelAdmin
from
.
import
models
@
admin
.
register
(
models
.
Committee
)
class
CommitteeAdmin
(
TranslatedModelAdmin
):
list_filter
=
(
'until'
,)
...
...
@@ -25,6 +26,15 @@ class CommitteeAdmin(TranslatedModelAdmin):
class
BoardAdmin
(
TranslatedModelAdmin
):
exclude
=
(
'is_board'
,)
fieldsets
=
(
(
None
,
{
'fields'
:
(
'description'
,
'photo'
,
'permissions'
,
'since'
,
'until'
)
}),
)
@
admin
.
register
(
models
.
CommitteeMembership
)
class
CommitteeMembershipAdmin
(
admin
.
ModelAdmin
):
...
...
website/activemembers/models.py
View file @
ae817a24
...
...
@@ -3,6 +3,7 @@ import logging
from
django.core.exceptions
import
ValidationError
,
NON_FIELD_ERRORS
from
django.contrib.auth.models
import
Permission
from
django.conf
import
settings
from
django.db
import
models
from
django.urls
import
reverse
from
django.utils
import
timezone
...
...
@@ -104,6 +105,12 @@ class Board(Committee):
default
=
True
,
)
def
clean
(
self
):
for
lang
in
settings
.
LANGUAGES
:
field_name
=
'{}_{}'
.
format
(
'name'
,
lang
[
0
])
setattr
(
self
,
field_name
,
'{} {} - {}'
.
format
(
'Board'
,
self
.
since
,
self
.
until
))
def
get_absolute_url
(
self
):
return
reverse
(
'committees:board'
,
args
=
[
str
(
self
.
pk
)])
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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