inf email

This commit is contained in:
Jaya Surya 2023-08-02 17:02:40 +05:30
parent 4239dbc76c
commit 54a6efeb31
1 changed files with 6 additions and 8 deletions

View File

@ -184,15 +184,13 @@ class InternshipResources(resources.ModelResource):
class InternAdmin(ExportMixin, SimpleHistoryAdmin):
resource_class = InternshipResources
# def save_model(self, request, obj, form, change):
# # Check if email_verified field is being changed from False to True
# if change and not obj._state.adding and obj.email_verified and form.initial.get('email_verified', False) != obj.email_verified:
# # Run the send_email_for_opening function
# send_email_for_opening(obj)
#
# # Save the model as usual
# super().save_model(request, obj, form, change)
def save_model(self, request, obj, form, change):
# Check if email_verified field is being changed from False to True
if change and not obj._state.adding and obj.email_verified and form.initial.get('email_verified', False) != obj.email_verified:
# Run the send_email_for_opening function
send_email_for_opening(obj)
super().save_model(request, obj, form, change)
@admin.register(Internship)