def submit_form(self, form, target): new_ban = Ban(test=form.cleaned_data['test'], ban=form.cleaned_data['ban'], reason_user=form.cleaned_data['reason_user'], reason_admin=form.cleaned_data['reason_admin'], expires=form.cleaned_data['expires']) new_ban.save(force_insert=True) self.request.monitor.increase('bans_version') return new_ban, Message(_('New Ban has been set.'), 'success')
def submit_form(self, form, target): new_ban = Ban( test=form.cleaned_data['test'], ban=form.cleaned_data['ban'], reason_user=form.cleaned_data['reason_user'], reason_admin=form.cleaned_data['reason_admin'], expires=form.cleaned_data['expires'] ) new_ban.save(force_insert=True) self.request.monitor.increase('bans_version') return new_ban, Message(_('New Ban has been set.'), 'success')
def submit_form(self, form, target): new_ban = Ban( test=form.cleaned_data['test'], ban=form.cleaned_data['ban'], reason_user=form.cleaned_data['reason_user'], reason_admin=form.cleaned_data['reason_admin'], expires=form.cleaned_data['expires'] ) new_ban.save(force_insert=True) with UpdatingMonitor() as cm: monitor.increase('bans_version') return new_ban, Message(_('New Ban has been set.'), messages.SUCCESS)