fixes post flood error messages

This commit is contained in:
Nathan Dinsmore 2013-02-18 18:59:27 -05:00
parent 05eec6deae
commit e60c4c72d9

View file

@ -106,11 +106,11 @@ class AddPostForm(forms.ModelForm):
if forum_settings.POST_FLOOD and not self.user.has_perm('djangobb_forum.fast_post'):
if self.user.has_perm('djangobb_forum.med_post'):
if lastpost_diff.total_seconds() < forum_settings.POST_FLOOD_MED:
self._errors['body'] = _("Sorry, you have to wait %d seconds between posts." % forum_settings.POST_FLOOD_MED)
self._errors['body'] = self.error_class([_("Sorry, you have to wait %d seconds between posts." % forum_settings.POST_FLOOD_MED)])
else:
if lastpost_diff.total_seconds() < forum_settings.POST_FLOOD_SLOW:
self._errors['body'] = _("Sorry, you have to wait %d seconds between posts." % forum_settings.POST_FLOOD_SLOW)
self._errors['body'] = self.error_class([_("Sorry, you have to wait %d seconds between posts." % forum_settings.POST_FLOOD_SLOW)])
return cleaned_data