mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-11 21:26:02 +00:00
Club model implementation, various other changes
This commit is contained in:
1 parent
7f4955d15c
commit
4322318c31
26 files changed
+267
-204
No files matched your search
@@ -42,6 +42,7 @@ class CanEditMixin(View):
|
||||
try: # Always unlock when 403
|
||||
self.object.unset_lock()
|
||||
except: pass
|
||||
print("CanEditMixin 403")
|
||||
raise PermissionDenied
|
||||
|
||||
class CanViewMixin(View):
|
||||
@@ -56,6 +57,7 @@ class CanViewMixin(View):
|
||||
try: # Always unlock when 403
|
||||
self.object.unset_lock()
|
||||
except: pass
|
||||
print("CanViewMixin 403")
|
||||
raise PermissionDenied
|
||||
|
||||
from .user import *
|
||||
|
||||
+3
-2
@@ -3,15 +3,16 @@ from django.views.generic import ListView
|
||||
|
||||
from core.models import Group
|
||||
from core.views.forms import GroupEditForm
|
||||
from core.views import CanEditMixin
|
||||
|
||||
class GroupListView(ListView):
|
||||
class GroupListView(CanEditMixin, ListView):
|
||||
"""
|
||||
Displays the group list
|
||||
"""
|
||||
model = Group
|
||||
template_name = "core/group_list.html"
|
||||
|
||||
class GroupEditView(UpdateView):
|
||||
class GroupEditView(CanEditMixin, UpdateView):
|
||||
model = Group
|
||||
pk_url_kwarg = "group_id"
|
||||
template_name = "core/group_edit.html"
|
||||
|
||||
Reference in new issue
Block a user