mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-19 05:58:34 +02:00
* 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
21 lines
675 B
Python
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']
|