Skip to content

Commit ba18c2e

Browse files
fix: Prevent editing submissions after CFP deadline (Fixes #1269)
1 parent 2a5fe91 commit ba18c2e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

app/eventyay/cfp/views/user.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from django.core.exceptions import ValidationError
88
from django.core.validators import validate_email
99
from django.forms.models import BaseModelFormSet, inlineformset_factory
10-
from django.http import Http4 horrenda4
10+
from django.http import Http404
1111
from django.shortcuts import get_object_or_404, redirect
1212
from django.utils.decorators import method_decorator
1313
from django.utils.functional import cached_property
@@ -119,10 +119,10 @@ def has_permission(self):
119119
)
120120

121121
def dispatch(self, request, *args, **kwargs):
122-
if self.request.user not in self.get_object().speakers.all():
122+
if self.request.user not in self.object.speakers.all():
123123
# User has permission to see permission, but not to see this particular
124124
# page, so we redirect them to the organiser page
125-
return redirect(self.get_object().orga_urls.base)
125+
return redirect(self.object.orga_urls.base)
126126
return super().dispatch(request, *args, **kwargs)
127127

128128
def get_object(self):
@@ -280,13 +280,14 @@ class SubmissionsEditView(LoggedInEventPageMixin, SubmissionViewMixin, UpdateVie
280280
write_permission_required = 'base.update_submission'
281281

282282
def dispatch(self, request, *args, **kwargs):
283-
if not self.get_object().editable:
284-
messages.error(self.request, phrases.cfp.submission_uneditable)
285-
return redirect(self.get_object().urls.user_base)
283+
obj = self.get_object()
284+
if not obj.editable:
285+
messages.error(request, phrases.cfp.submission_uneditable)
286+
return redirect(obj.urls.user_base)
286287
return super().dispatch(request, *args, **kwargs)
287288

288289
def get_permission_object(self):
289-
return self.get_object()
290+
return self.object
290291

291292
@context
292293
def size_warning(self):

0 commit comments

Comments
 (0)