浏览代码

refactor(api): remove dead code

Peter Thomassen 2 年之前
父节点
当前提交
ac6389b494
共有 2 个文件被更改,包括 1 次插入13 次删除
  1. 0 1
      api/desecapi/crypto.py
  2. 1 12
      api/desecapi/models.py

+ 0 - 1
api/desecapi/crypto.py

@@ -1,5 +1,4 @@
 from base64 import urlsafe_b64encode
-from enum import Enum
 
 from cryptography.fernet import Fernet, InvalidToken
 from cryptography.hazmat.primitives import hashes

+ 1 - 12
api/desecapi/models.py

@@ -64,8 +64,7 @@ def validate_upper(value):
 class MyUserManager(BaseUserManager):
     def create_user(self, email, password, **extra_fields):
         """
-        Creates and saves a User with the given email, date of
-        birth and password.
+        Creates and saves a User with the given email and password.
         """
         if not email:
             raise ValueError('Users must have an email address')
@@ -76,16 +75,6 @@ class MyUserManager(BaseUserManager):
         user.save(using=self._db)
         return user
 
-    def create_superuser(self, email, password):
-        """
-        Creates and saves a superuser with the given email, date of
-        birth and password.
-        """
-        user = self.create_user(email, password=password)
-        user.is_admin = True
-        user.save(using=self._db)
-        return user
-
 
 class User(ExportModelOperationsMixin('User'), AbstractBaseUser):
     @staticmethod