Exemplo n.º 1
0
Arquivo: views.py Projeto: xyzz/Misago
 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')
Exemplo n.º 2
0
 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')
Exemplo n.º 3
0
 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)