feat: allow bulk email templates to be deleted

There are some old bulk email templates in the database that we don’t
need anymore. We need to make this change in order to delete them. After
removing the templates we want to remove, we’ll leave in the ability to
delete.

[MICROBA-1573]
This commit is contained in:
oliviaruizknott
2021-11-23 10:59:46 -05:00
parent fe067bab16
commit eb1797d210

View File

@@ -57,19 +57,11 @@ unsupported tags will cause email sending to fail.
'''
}),
)
# Turn off the action bar (we have no bulk actions)
actions = None
def has_add_permission(self, request):
"""Enable the ability to add new templates, as we want to be able to define multiple templates."""
return True
def has_delete_permission(self, request, obj=None):
"""
Disables the ability to remove existing templates, as we'd like to make sure we don't have dangling references.
"""
return False
class CourseAuthorizationAdmin(admin.ModelAdmin):
"""Admin for enabling email on a course-by-course basis."""