fix keyerror in plcorebase.delete
Scott Baker [Thu, 9 Oct 2014 23:22:00 +0000 (16:22 -0700)]
planetstack/core/models/plcorebase.py
planetstack/core/models/user.py

index 000e77e..57025b4 100644 (file)
@@ -117,14 +117,17 @@ class PlCoreBase(models.Model, DiffModelMixIn):
     def delete(self, *args, **kwds):
         # so we have something to give the observer
         purge = kwds.get('purge',False)
+        if purge:
+            del kwds['purge']
         silent = kwds.get('silent',False)
+        if silent:
+            del kwds['silent']
         try:
             purge = purge or observer_disabled
         except NameError:
             pass
 
         if (purge):
-            del kwds['purge']
             super(PlCoreBase, self).delete(*args, **kwds)
         else:
             self.deleted = True
index 1b3be29..8dc87b3 100644 (file)
@@ -135,6 +135,8 @@ class User(AbstractBaseUser, DiffModelMixIn):
     def delete(self, *args, **kwds):
         # so we have something to give the observer
         purge = kwds.get('purge',False)
+        if purge:
+            del kwds['purge']
         try:
             purge = purge or observer_disabled
         except NameError: