Add last-minute check to ensure master views allows deletion
Generally for the 'delete' route to even exist the master view *class* must still allow deletions. But once a request is involved and we have a view *instance* then we can disable deletions if we like.
This commit is contained in:
parent
0f3f39d5c6
commit
aaf5ca97f9
|
@ -166,6 +166,9 @@ class MasterView(View):
|
|||
"""
|
||||
View for deleting an existing model record.
|
||||
"""
|
||||
if not self.deletable:
|
||||
raise httpexceptions.HTTPForbidden()
|
||||
|
||||
self.deleting = True
|
||||
instance = self.get_instance()
|
||||
instance_title = self.get_instance_title(instance)
|
||||
|
|
Loading…
Reference in a new issue