예제 #1
0
 def create_staff_user(self):
     user = UserFactory(username=self.username,
                        email=self.email,
                        password=self.password)
     user.is_staff = True
     user.save()
     return user
예제 #2
0
파일: base.py 프로젝트: chaabni/SmartElect
 def create_staff_user(self):
     user = UserFactory(username=self.username, email=self.email, password=self.password)
     user.is_staff = True
     user.save()
     if self.model:
         content_type = ContentType.objects.get_for_model(self.model)
         for perm in self.permissions:
             user.user_permissions.add(Permission.objects.get(content_type=content_type,
                                                              codename=perm))
     return user
예제 #3
0
 def create_staff_user(self):
     user = UserFactory(username=self.username,
                        email=self.email,
                        password=self.password)
     user.is_staff = True
     user.save()
     if self.model:
         content_type = ContentType.objects.get_for_model(self.model)
         for perm in self.permissions:
             user.user_permissions.add(
                 Permission.objects.get(content_type=content_type,
                                        codename=perm))
     return user
예제 #4
0
 def create_staff_user(self):
     user = UserFactory(username=self.username, email=self.email,
                        password=self.password)
     user.is_staff = True
     user.save()
     return user