diff --git a/lemarche/tenders/admin.py b/lemarche/tenders/admin.py index f97f06220..f38e147e3 100644 --- a/lemarche/tenders/admin.py +++ b/lemarche/tenders/admin.py @@ -593,6 +593,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):