From fadc609a646e19db75d29ecd664e51c71d1da29f Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Fri, 27 Jun 2014 15:28:31 +0200 Subject: [PATCH 1/2] Don't display quota if unlimited. fix #566 --- modoboa/extensions/webmail/templates/webmail/index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modoboa/extensions/webmail/templates/webmail/index.html b/modoboa/extensions/webmail/templates/webmail/index.html index de45b6271..af6e3ee3d 100644 --- a/modoboa/extensions/webmail/templates/webmail/index.html +++ b/modoboa/extensions/webmail/templates/webmail/index.html @@ -37,6 +37,7 @@ $(document).ready(function() {
{% endblock %} {% block footerleft %} +{% if quota != -1 %}
@@ -44,5 +45,6 @@ $(document).ready(function() {
+{% endif %} {% endblock %} From bf368f656a361203ef54f02f85ed57f1318fc7fd Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Fri, 27 Jun 2014 15:40:01 +0200 Subject: [PATCH 2/2] Check if dates are too old only when the reply is activated. fix #570 --- modoboa/extensions/postfix_autoreply/forms.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modoboa/extensions/postfix_autoreply/forms.py b/modoboa/extensions/postfix_autoreply/forms.py index cf9cd5ad4..f87b4dea6 100644 --- a/modoboa/extensions/postfix_autoreply/forms.py +++ b/modoboa/extensions/postfix_autoreply/forms.py @@ -1,5 +1,4 @@ # coding: utf-8 -import datetime from django import forms from django.utils.translation import ugettext as _, ugettext_lazy from django.utils import timezone @@ -42,20 +41,25 @@ class ARmessageForm(forms.ModelForm): """Custom fields validaton. We want to be sure that fromdate < untildate and that they are - both in the future. + both in the future ONLY IF the autoreply is beeing activated. + """ super(ARmessageForm, self).clean() if self._errors: raise forms.ValidationError(self._errors) + if not self.cleaned_data["enabled"]: + return self.cleaned_data if self.cleaned_data["fromdate"] is not None: if self.cleaned_data["fromdate"] < timezone.now(): - self._errors["fromdate"] = self.error_class([_("This date is over")]) + self._errors["fromdate"] = self.error_class( + [_("This date is over")]) del self.cleaned_data['fromdate'] else: self.cleaned_data['fromdate'] = timezone.now() if self.cleaned_data["untildate"] is not None: if self.cleaned_data["untildate"] < timezone.now(): - self._errors["untildate"] = self.error_class([_("This date is over")]) + self._errors["untildate"] = self.error_class( + [_("This date is over")]) del self.cleaned_data['untildate'] elif 'fromdate' in self.cleaned_data and \ self.cleaned_data['untildate'] < self.cleaned_data['fromdate']: