• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DemocracyClub / aggregator-api / 26192a4c-09ee-45f2-9fd7-d44d0520c829

04 Sep 2024 12:54PM UTC coverage: 76.041%. Remained the same
26192a4c-09ee-45f2-9fd7-d44d0520c829

push

circleci

chris48s
ensure setuptools is in frontend layer

1187 of 1561 relevant lines covered (76.04%)

0.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

22.73
/frontend/apps/api_users/managers.py
1
from django.contrib.auth.base_user import BaseUserManager
1✔
2

3

4
class CustomUserManager(BaseUserManager):
1✔
5
    """
6
    Custom manager methods adapted from those found on the stock UserManager
7
    django class to remove username field.
8
    """
9

10
    def _create_user(self, email, password, **extra_fields):
1✔
11
        """
12
        Create and save a user with the given email, and password.
13
        """
14
        if not email:
×
15
            raise ValueError("The given email must be set")
×
16

17
        email = self.normalize_email(email)
×
18
        user = self.model(email=email, **extra_fields)
×
19
        user.set_password(password)
×
20
        user.save(using=self._db)
×
21
        return user
×
22

23
    def create_user(self, email, password=None, **extra_fields):
1✔
24
        extra_fields.setdefault("is_staff", False)
×
25
        extra_fields.setdefault("is_superuser", False)
×
26
        return self._create_user(email, password, **extra_fields)
×
27

28
    def create_superuser(self, email, password, **extra_fields):
1✔
29
        extra_fields.setdefault("is_staff", True)
×
30
        extra_fields.setdefault("is_superuser", True)
×
31

32
        if extra_fields.get("is_staff") is not True:
×
33
            raise ValueError("Superuser must have is_staff=True.")
×
34
        if extra_fields.get("is_superuser") is not True:
×
35
            raise ValueError("Superuser must have is_superuser=True.")
×
36

37
        return self._create_user(email, password, **extra_fields)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc