|
7 | 7 | from django.core.exceptions import ValidationError |
8 | 8 | from django.core.validators import validate_email |
9 | 9 | from django.forms.models import BaseModelFormSet, inlineformset_factory |
10 | | -from django.http import Http4 horrenda4 |
| 10 | +from django.http import Http404 |
11 | 11 | from django.shortcuts import get_object_or_404, redirect |
12 | 12 | from django.utils.decorators import method_decorator |
13 | 13 | from django.utils.functional import cached_property |
@@ -119,10 +119,10 @@ def has_permission(self): |
119 | 119 | ) |
120 | 120 |
|
121 | 121 | 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(): |
123 | 123 | # User has permission to see permission, but not to see this particular |
124 | 124 | # 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) |
126 | 126 | return super().dispatch(request, *args, **kwargs) |
127 | 127 |
|
128 | 128 | def get_object(self): |
@@ -280,13 +280,14 @@ class SubmissionsEditView(LoggedInEventPageMixin, SubmissionViewMixin, UpdateVie |
280 | 280 | write_permission_required = 'base.update_submission' |
281 | 281 |
|
282 | 282 | 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) |
286 | 287 | return super().dispatch(request, *args, **kwargs) |
287 | 288 |
|
288 | 289 | def get_permission_object(self): |
289 | | - return self.get_object() |
| 290 | + return self.object |
290 | 291 |
|
291 | 292 | @context |
292 | 293 | def size_warning(self): |
|
0 commit comments