diff --git a/AKDashboard/views.py b/AKDashboard/views.py index 9d9518d85d20bbaa1af89422da8847cb33173410..afabaf7df0b61574baf12d67d2ae86ac35a8bc83 100644 --- a/AKDashboard/views.py +++ b/AKDashboard/views.py @@ -54,7 +54,7 @@ class DashboardEventView(DetailView): # Changes in plan if apps.is_installed("AKPlan"): if not context['event'].plan_hidden: - last_changed_slots = AKSlot.objects.filter(event=context['event']).order_by('-updated')[ + last_changed_slots = AKSlot.objects.filter(event=context['event'], start__isnull=False).order_by('-updated')[ :int(settings.DASHBOARD_RECENT_MAX)] for changed_slot in last_changed_slots: recent_changes.append({'icon': ('clock', 'far'), diff --git a/AKSubmission/views.py b/AKSubmission/views.py index 18972682116bb1c21751eae6af7b73957808558c..46c6fa55a65ad7d1903ee0b1578cd321f64e3bf1 100644 --- a/AKSubmission/views.py +++ b/AKSubmission/views.py @@ -215,7 +215,8 @@ class AKAndAKWishSubmissionView(EventSlugMixin, EventInactiveRedirectMixin, Crea return redirect(reverse_lazy('submit:submission_overview', kwargs={'event_slug': form.cleaned_data["event"].slug})) - super_form_valid = super().form_valid(form) + # Generate object but don't store it in the database yet + self.object = form.save(commit=False) # Generate wiki link if form.cleaned_data["event"].base_url: @@ -225,7 +226,9 @@ class AKAndAKWishSubmissionView(EventSlugMixin, EventInactiveRedirectMixin, Crea if len(link) > 200: messages.add_message(self.request, messages.WARNING, _("Due to technical reasons, the link you entered was truncated to a length of 200 characters")) - self.object.save() + + # Try to save AK and get redirect URL + super_form_valid = super().form_valid(form) # Set tags (and generate them if necessary) for tag_name in form.cleaned_data["tag_names"]: