mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
fix: do not save the domain if not necessary.
it will also avoid the trigger of two post_save signals for the domain, which can lead to unexpected issues. see #1380
This commit is contained in:
@@ -37,6 +37,7 @@ class RelayDomainFormGeneral(tr_forms.TransportForm):
|
||||
instance.pattern = domain.name
|
||||
instance.service = "relay"
|
||||
instance.save()
|
||||
domain.transport = instance
|
||||
domain.save(update_fields=["transport"])
|
||||
if not domain.transport:
|
||||
domain.transport = instance
|
||||
domain.save(update_fields=["transport"])
|
||||
return instance
|
||||
|
||||
Reference in New Issue
Block a user