mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
@@ -97,6 +97,7 @@ class DomainFormGeneral(forms.ModelForm, DynamicForm):
|
||||
% unicode(label)
|
||||
)
|
||||
condition = (
|
||||
self.cleaned_data["quota"] != 0 and
|
||||
self.cleaned_data["default_mailbox_quota"] >
|
||||
self.cleaned_data["quota"])
|
||||
if condition:
|
||||
|
||||
@@ -29,8 +29,8 @@ class DomainSerializer(serializers.ModelSerializer):
|
||||
|
||||
def validate(self, data):
|
||||
"""Check quota values."""
|
||||
quota = data["quota"]
|
||||
default_mailbox_quota = data["default_mailbox_quota"]
|
||||
quota = data.get("quota", 0)
|
||||
default_mailbox_quota = data.get("default_mailbox_quota", 0)
|
||||
if quota != 0 and default_mailbox_quota > quota:
|
||||
raise serializers.ValidationError({
|
||||
"default_mailbox_quota":
|
||||
|
||||
Reference in New Issue
Block a user