mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-20 17:41:55 +02:00
Add initial WEI permissions
This commit is contained in:
@ -34,7 +34,6 @@ class WEISurveyInformation:
|
||||
Store the data of the survey into the database, with the information of the registration.
|
||||
"""
|
||||
registration.information = self.__dict__
|
||||
registration.save()
|
||||
|
||||
|
||||
class WEISurveyAlgorithm:
|
||||
@ -140,6 +139,10 @@ class WEISurvey:
|
||||
Store the information of the survey into the database.
|
||||
"""
|
||||
self.information.save(self.registration)
|
||||
# The information is forced-saved.
|
||||
# We don't want that anyone can update manually the information, so since most users don't have the
|
||||
# right to save the information of a registration, we force save.
|
||||
self.registration._force_save = True
|
||||
self.registration.save()
|
||||
|
||||
@classmethod
|
||||
|
@ -28,8 +28,12 @@ from .tables import WEITable, WEIRegistrationTable, BusTable, BusTeamTable, WEIM
|
||||
|
||||
class CurrentWEIDetailView(LoginRequiredMixin, RedirectView):
|
||||
def get_redirect_url(self, *args, **kwargs):
|
||||
wei = WEIClub.objects.filter(membership_start__lte=date.today()).order_by('date_start').last()
|
||||
return reverse_lazy('wei:wei_detail', args=(wei.pk,))
|
||||
wei = WEIClub.objects.filter(membership_start__lte=date.today()).order_by('date_start')
|
||||
if wei.exists():
|
||||
wei = wei.last()
|
||||
return reverse_lazy('wei:wei_detail', args=(wei.pk,))
|
||||
else:
|
||||
return reverse_lazy('wei:wei_list')
|
||||
|
||||
|
||||
class WEIListView(ProtectQuerysetMixin, LoginRequiredMixin, SingleTableView):
|
||||
|
Reference in New Issue
Block a user