diff --git a/lemarche/tenders/admin.py b/lemarche/tenders/admin.py index ef8d7f4d6..31f1f253a 100644 --- a/lemarche/tenders/admin.py +++ b/lemarche/tenders/admin.py @@ -614,6 +614,9 @@ def get_readonly_fields(self, request, obj=None): # slug cannot be changed once the tender is validated if obj.status == tender_constants.STATUS_VALIDATED: readonly_fields.append("slug") + # cannot edit 'email_sent_for_modification' while tender is not published + if obj and obj.email_sent_for_modification and obj.status != Tender.STATUS_PUBLISHED: + readonly_fields.append("email_sent_for_modification") return readonly_fields def save_model(self, request, obj: Tender, form, change):