Trigger save logic when archiving students through admin action
This commit is contained in:
parent
0c9355d773
commit
8e4c15f1db
1 changed files with 4 additions and 1 deletions
|
|
@ -81,7 +81,10 @@ class StudentAdmin(admin.ModelAdmin):
|
|||
actions = ['archive']
|
||||
|
||||
def archive(self, request, queryset):
|
||||
queryset.update(archived=True)
|
||||
for student in queryset:
|
||||
# Save each item individually to allow for custom save() logic.
|
||||
student.archived = True
|
||||
student.save()
|
||||
archive.short_description = "Marquer les étudiants sélectionnés comme archivés"
|
||||
|
||||
'''def get_readonly_fields(self, request, obj=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue