Added deletion check as a default filter of the User model.
authorSapan Bhatia <gwsapan@gmail.com>
Tue, 29 Apr 2014 18:41:23 +0000 (14:41 -0400)
committerSapan Bhatia <gwsapan@gmail.com>
Wed, 23 Jul 2014 20:08:38 +0000 (16:08 -0400)
planetstack/core/models/user.py

index 2d964a4..0272661 100644 (file)
@@ -11,6 +11,9 @@ from operator import itemgetter, attrgetter
 
 # Create your models here.
 class UserManager(BaseUserManager):
+    def get_query_set(self):
+        return super(UserManager, self).get_query_set().filter(deleted=False)
+
     def create_user(self, email, firstname, lastname, password=None):
         """
         Creates and saves a User with the given email, date of