From 3ecd0920291870304ce71e5b6800d310b84b3fc2 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Mon, 2 Jun 2025 15:29:09 +0200 Subject: Only allow superusers to edit mail quota --- pgmailmgr/mailmgr/forms.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pgmailmgr') diff --git a/pgmailmgr/mailmgr/forms.py b/pgmailmgr/mailmgr/forms.py index 91ee7bd..657e906 100644 --- a/pgmailmgr/mailmgr/forms.py +++ b/pgmailmgr/mailmgr/forms.py @@ -65,6 +65,9 @@ class VirtualUserForm(forms.ModelForm): if self.instance.pk: self.fields['local_domain'].disabled = True + if not user.is_superuser: + del self.fields['mail_quota'] + def clean_local_domain(self): if not self.instance.pk: return self.cleaned_data['local_domain'] -- cgit v1.2.3