Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contact info #231

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ django-autocomplete-light
environs[django]
whitenoise # Used for static files in production
Pillow # This one can possibly be removed

django-phonenumber-field[phonenumbers]
2 changes: 2 additions & 0 deletions scaladining/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def file_parser(value):
'allauth',
'allauth.socialaccount',
'allauthproviders.quadrivium',

'phonenumber_field',
]

MIDDLEWARE = [
Expand Down
9 changes: 9 additions & 0 deletions userdetails/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@
from django.db import models
from django.utils import timezone
from django.utils.functional import cached_property
from phonenumber_field.modelfields import PhoneNumberField

from .managers import UserManager, AssociationManager


class User(AbstractUser):
email = models.EmailField("email address", unique=True)

# PhoneNumberField uses a phone number input widget and prevents abuse of the field for non-phone number data.
phone_number = PhoneNumberField(blank=True, help_text="If given, will be visible to other diners on the same list.")
email_public = models.BooleanField(
'email public',
default=False,
help_text="If selected, your email address will be visible to other diners on the same list."
)

objects = UserManager()

def __str__(self):
Expand Down