projects
/
pgmailmgr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
37a93e8
)
Disable the local part field when it can't be changed
author
Magnus Hagander
<magnus@hagander.net>
Mon, 2 Jun 2025 13:27:33 +0000
(15:27 +0200)
committer
Magnus Hagander
<magnus@hagander.net>
Mon, 2 Jun 2025 13:27:33 +0000
(15:27 +0200)
Iẗ́'s silly to have a dropdown you can change and only give an error
message later :)
pgmailmgr/mailmgr/forms.py
patch
|
blob
|
blame
|
history
diff --git
a/pgmailmgr/mailmgr/forms.py
b/pgmailmgr/mailmgr/forms.py
index a3c59b7c593ba6b87bebdd48c047ac1b344d9e2a..91ee7bd7671d16f9ab456bea209f2631130ad7c1 100644
(file)
--- a/
pgmailmgr/mailmgr/forms.py
+++ b/
pgmailmgr/mailmgr/forms.py
@@
-62,6
+62,9
@@
class VirtualUserForm(forms.ModelForm):
self.fields['account'] = forms.CharField(max_length=200, widget=AccountEmailWidget(instance.account), required=False)
+ if self.instance.pk:
+ self.fields['local_domain'].disabled = True
+
def clean_local_domain(self):
if not self.instance.pk:
return self.cleaned_data['local_domain']