def post(self, *args, **kwargs): form = CommentForm(self.request.POST) if form.is_valid(): if form.cleaned_data.get('comment') != self.order.comment: self.order.comment = form.cleaned_data.get('comment') self.order.log_action( 'pretix.event.order.comment', user=self.request.user, data={'new_comment': form.cleaned_data.get('comment')}) if form.cleaned_data.get( 'checkin_attention') != self.order.checkin_attention: self.order.checkin_attention = form.cleaned_data.get( 'checkin_attention') self.order.log_action( 'pretix.event.order.checkin_attention', user=self.request.user, data={ 'new_value': form.cleaned_data.get('checkin_attention') }) self.order.save() messages.success(self.request, _('The comment has been updated.')) else: messages.error(self.request, _('Could not update the comment.')) return redirect(self.get_order_url())
def post(self, *args, **kwargs): form = CommentForm(self.request.POST) if form.is_valid(): self.order.comment = form.cleaned_data.get('comment') self.order.save() self.order.log_action('pretix.event.order.comment', user=self.request.user) messages.success(self.request, _('The comment has been updated.')) else: messages.error(self.request, _('Could not update the comment.')) return redirect(self.get_order_url())
def get_context_data(self, **kwargs): ctx = super().get_context_data(**kwargs) ctx['items'] = self.get_items() ctx['event'] = self.request.event ctx['payment'] = self.payment_provider.order_control_render(self.request, self.object) ctx['invoices'] = list(self.order.invoices.all().select_related('event')) ctx['comment_form'] = CommentForm(initial={'comment': self.order.comment}) return ctx
def get_context_data(self, **kwargs): ctx = super().get_context_data(**kwargs) ctx['items'] = self.get_items() ctx['event'] = self.request.event ctx['payment'] = self.payment_provider.order_control_render(self.request, self.object) ctx['invoices'] = list(self.order.invoices.all().select_related('event')) ctx['comment_form'] = CommentForm(initial={'comment': self.order.comment}) ctx['display_locale'] = dict(settings.LANGUAGES)[self.object.locale or self.request.event.settings.locale] return ctx
def get_context_data(self, **kwargs): ctx = super().get_context_data(**kwargs) ctx['items'] = self.get_items() ctx['event'] = self.request.event ctx['download_buttons'] = self.download_buttons ctx['can_download'] = (self.request.event.settings.ticket_download and self.order.status == Order.STATUS_PAID) ctx['payment'] = self.payment_provider.order_control_render( self.request, self.object) ctx['invoices'] = list( self.order.invoices.all().select_related('event')) ctx['comment_form'] = CommentForm( initial={'comment': self.order.comment}) return ctx
def get_context_data(self, **kwargs): ctx = super().get_context_data(**kwargs) ctx['items'] = self.get_items() ctx['event'] = self.request.event ctx['payment_provider'] = self.payment_provider if self.payment_provider: ctx['payment'] = self.payment_provider.order_control_render( self.request, self.object) else: ctx['payment'] = mark_safe( '<div class="alert alert-danger">{}</div>'.format( _('This order was paid using a payment provider plugin that is now disabled or uninstalled.' ))) ctx['invoices'] = list( self.order.invoices.all().select_related('event')) ctx['comment_form'] = CommentForm( initial={ 'comment': self.order.comment, 'checkin_attention': self.order.checkin_attention }) ctx['display_locale'] = dict( settings.LANGUAGES)[self.object.locale or self.request.event.settings.locale] return ctx