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
AE UTBM
Sith
Commits
3302fdc6
Commit
3302fdc6
authored
Apr 12, 2016
by
Skia
🤘
Browse files
Small club fix
parent
e4070c86
Changes
2
Hide whitespace changes
Inline
Side-by-side
club/models.py
View file @
3302fdc6
...
...
@@ -3,6 +3,7 @@ from django.core import validators
from
django.conf
import
settings
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.core.exceptions
import
ValidationError
from
django.db
import
IntegrityError
from
django.core.urlresolvers
import
reverse
from
core.models
import
User
,
MetaGroup
,
Group
...
...
@@ -50,8 +51,12 @@ class Club(models.Model):
def
save
(
self
):
super
(
Club
,
self
).
save
()
MetaGroup
(
name
=
self
.
unix_name
+
settings
.
SITH_BOARD_SUFFIX
).
save
()
MetaGroup
(
name
=
self
.
unix_name
+
settings
.
SITH_MEMBER_SUFFIX
).
save
()
try
:
MetaGroup
(
name
=
self
.
unix_name
+
settings
.
SITH_BOARD_SUFFIX
).
save
()
MetaGroup
(
name
=
self
.
unix_name
+
settings
.
SITH_MEMBER_SUFFIX
).
save
()
except
IntegrityError
as
e
:
# Groups already exists
pass
def
__str__
(
self
):
return
self
.
name
...
...
club/views.py
View file @
3302fdc6
...
...
@@ -94,6 +94,6 @@ class ClubEditPropView(CanEditPropMixin, UpdateView):
"""
model
=
Club
pk_url_kwarg
=
"club_id"
fields
=
[
'name'
,
'parent'
]
fields
=
[
'name'
,
'unix_name'
,
'parent'
]
template_name
=
'club/club_edit_prop.jinja'
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