Files
modoboa/extensions/postfix_autoreply/forms.py
T
Antoine Nguyen a295aa1ab6 wip: Global user interface improvment
* Use of jQuery in place of Mootools
* Most of the custom mootools plugins have been ported to jQuery
* Use of bootstrap from Twitter in place of the old CSS
* Most of the admin templates have been reworked
* The sievefilters extension has been ported
* The postfix autoreply extension is almost done
* more...

see #204
2012-03-19 15:13:01 +01:00

21 lines
675 B
Python

from django import forms
from models import ARmessage
from django.utils.translation import ugettext as _
import datetime
class ARmessageForm(forms.ModelForm):
untildate = forms.DateField(
label=_('Until'), required=False,
help_text=_("Activate your auto reply until this date")
)
class Meta:
model = ARmessage
fields = ('subject', 'content', 'enabled')
def clean_untildate(self):
if self.cleaned_data["untildate"] is not None:
if self.cleaned_data["untildate"] < datetime.date.today():
raise forms.ValidationError(_("This date is over"))
return self.cleaned_data['untildate']