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:
Lance Edgar 2016-03-24 00:24:25 -05:00
parent 0f3f39d5c6
commit aaf5ca97f9

View file

@ -166,6 +166,9 @@ class MasterView(View):
""" """
View for deleting an existing model record. View for deleting an existing model record.
""" """
if not self.deletable:
raise httpexceptions.HTTPForbidden()
self.deleting = True self.deleting = True
instance = self.get_instance() instance = self.get_instance()
instance_title = self.get_instance_title(instance) instance_title = self.get_instance_title(instance)