This commit is contained in:
@@ -543,6 +543,18 @@ class EventUpdateStatusView(EventPermissionMixin, generic.DetailView):
|
||||
messages.error(request, message)
|
||||
return HttpResponseRedirect(event.get_absolute_url())
|
||||
|
||||
if not event.workflow.has_reached_status('publishing*') and not event.workflow.has_reached_status('published*'):
|
||||
cur_pub_date = event.planned_publication_date
|
||||
real_pub_date, real_pub_issue = event.workflow.plan_publication(event.first_day, event.deadline)
|
||||
if cur_pub_date != real_pub_date:
|
||||
if real_pub_date is None:
|
||||
real_pub_str = _(u'Unverzüglich')
|
||||
else:
|
||||
real_pub_str = u'%s (%s)' % (real_pub_date.strftime('%d.%m.%Y'), real_pub_issue)
|
||||
event.planned_publication_date = real_pub_date
|
||||
event.save()
|
||||
messages.warning(request, _(u'Veröffentlichungsdatum wurde angepasst: %s') % real_pub_str)
|
||||
|
||||
event.workflow.update_status(status, request.user)
|
||||
|
||||
if status.startswith('submit'):
|
||||
@@ -602,7 +614,21 @@ class EventUpdateView(EventPermissionMixin, generic.UpdateView):
|
||||
|
||||
def form_valid(self, form):
|
||||
form.instance.editor = self.request.user
|
||||
self.object = form.save()
|
||||
event = form.save()
|
||||
self.object = event
|
||||
|
||||
if not event.workflow.has_reached_status('publishing*') and not event.workflow.has_reached_status('published*'):
|
||||
cur_pub_date = event.planned_publication_date
|
||||
real_pub_date, real_pub_issue = event.workflow.plan_publication(event.first_day, event.deadline)
|
||||
if cur_pub_date != real_pub_date:
|
||||
if real_pub_date is None:
|
||||
real_pub_str = _(u'Unverzüglich')
|
||||
else:
|
||||
real_pub_str = u'%s (%s)' % (real_pub_date.strftime('%d.%m.%Y'), real_pub_issue)
|
||||
event.planned_publication_date = real_pub_date
|
||||
event.save()
|
||||
messages.warning(self.request, _(u'Veröffentlichungsdatum wurde angepasst: %s') % real_pub_str)
|
||||
|
||||
return HttpResponseRedirect(self.get_success_url())
|
||||
|
||||
@method_decorator(login_required)
|
||||
|
||||
Reference in New Issue
Block a user