forked from CEOS-Developers/django-vote-14th
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Team-MailedIt/feature-login
feat: fix app name account->member
- Loading branch information
Showing
16 changed files
with
136 additions
and
53 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class MemberConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'member' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from django.contrib.auth.models import BaseUserManager | ||
|
||
|
||
class UserManager(BaseUserManager): | ||
def _create_user(self, email, username, password, **extra_fields): | ||
|
||
""" | ||
Create and save a user with the given username, email, and password. | ||
""" | ||
|
||
email = self.normalize_email(email) | ||
|
||
username = self.model.normalize_username(username) | ||
|
||
user = self.model(email=email, username=username, **extra_fields) | ||
|
||
user.set_password(password) | ||
|
||
user.save(using=self._db) | ||
|
||
return user | ||
|
||
def create_user(self, email, username, password=None, **extra_fields): | ||
|
||
extra_fields.setdefault("is_staff", False) | ||
|
||
extra_fields.setdefault("is_superuser", False) | ||
|
||
return self._create_user(email, username, password, **extra_fields) | ||
|
||
def create_superuser(self, email, username, password, **extra_fields): | ||
|
||
extra_fields.setdefault("is_staff", True) | ||
|
||
extra_fields.setdefault("is_superuser", True) | ||
|
||
if extra_fields.get("is_staff") is not True: | ||
raise ValueError("Superuser must have is_staff=True.") | ||
|
||
if extra_fields.get("is_superuser") is not True: | ||
raise ValueError("Superuser must have is_superuser=True.") | ||
|
||
return self._create_user(email, username, password, **extra_fields) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,24 @@ | ||
asgiref==3.4.1 | ||
certifi==2021.10.8 | ||
cffi==1.15.0 | ||
charset-normalizer==2.0.9 | ||
cryptography==35.0.0 | ||
defusedxml==0.7.1 | ||
Django==3.0.8 | ||
django-allauth==0.47.0 | ||
django-cors-headers==3.10.0 | ||
django-environ==0.4.5 | ||
djangorestframework==3.12.4 | ||
djangorestframework-simplejwt==5.0.0 | ||
gunicorn==20.1.0 | ||
idna==3.3 | ||
oauthlib==3.1.1 | ||
pycparser==2.21 | ||
PyJWT==2.3.0 | ||
PyMySQL==1.0.2 | ||
python3-openid==3.2.0 | ||
pytz==2021.3 | ||
requests==2.26.0 | ||
requests-oauthlib==1.3.0 | ||
sqlparse==0.4.2 | ||
urllib3==1.26.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters