Add delete method for UserHostingKey
This commit is contained in:
parent
1ccb4e9790
commit
71d1e6e3c9
1 changed files with 6 additions and 0 deletions
|
@ -212,6 +212,12 @@ class UserHostingKey(models.Model):
|
|||
# self.save(update_fields=['public_key'])
|
||||
return private_key, public_key
|
||||
|
||||
def delete(self,*args,**kwargs):
|
||||
if os.path.isfile(self.private_key.path):
|
||||
os.remove(self.private_key.path)
|
||||
|
||||
super(UserHostingKey, self).delete(*args,**kwargs)
|
||||
|
||||
|
||||
class HostingBill(AssignPermissionsMixin, models.Model):
|
||||
customer = models.ForeignKey(StripeCustomer)
|
||||
|
|
Loading…
Reference in a new issue