-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8757321
commit a0b2dd5
Showing
12 changed files
with
181 additions
and
113 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{% autoescape off %} | ||
Dear {{ username }}, | ||
|
||
Please follow the link to confirm the account deletion, | ||
http://{{ domain }}{% url 'embark-deactivate-user' user_id=uid activation_token=token %} | ||
|
||
OR manually input the following token: {{ token }} | ||
{% endautoescape %} |
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
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,42 @@ | ||
from django import forms | ||
from django.contrib.auth.forms import UserCreationForm | ||
from django.contrib.auth import password_validation | ||
from django.contrib.auth.validators import UnicodeUsernameValidator | ||
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm | ||
from users.models import User | ||
|
||
|
||
class SignupForm(UserCreationForm): | ||
username_validator = UnicodeUsernameValidator() | ||
|
||
|
||
class SignUpForm(UserCreationForm): | ||
first_name = forms.CharField(max_length=12, min_length=4, required=False, help_text='Optional: First Name', | ||
widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'First Name'})) | ||
last_name = forms.CharField(max_length=12, min_length=4, required=False, help_text='Optional: Last Name', | ||
widget=(forms.TextInput(attrs={'class': 'form-control'}))) | ||
email = forms.EmailField(max_length=50, help_text='Required. Inform a valid email address.', | ||
widget=(forms.TextInput(attrs={'class': 'form-control'}))) | ||
password1 = forms.CharField(label='Password', | ||
widget=(forms.PasswordInput(attrs={'class': 'form-control'})), | ||
help_text=password_validation.password_validators_help_text_html()) | ||
password2 = forms.CharField(label='Password Confirmation', widget=forms.PasswordInput(attrs={'class': 'form-control'}), | ||
help_text='Just Enter the same password, for confirmation') | ||
username = forms.CharField( | ||
label='Username', | ||
max_length=150, | ||
help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', | ||
validators=[username_validator], | ||
error_messages={'unique': "A user with that username already exists."}, | ||
widget=forms.TextInput(attrs={'class': 'form-control'}) | ||
) | ||
usable_password = None | ||
class Meta: | ||
model = User | ||
fields = ('username', 'email', 'password1', 'password2') | ||
|
||
fields = ('username', 'first_name', 'last_name', 'email', 'password1', 'password2',) | ||
|
||
class ActivationForm(forms.Form): | ||
|
||
token = forms.CharField(max_length=256, min_length=256) | ||
class LoginForm(AuthenticationForm): | ||
error_messages = { | ||
"invalid_login": "Please enter a correct %(username)s and password. Note that both fields may be case-sensitive.", | ||
"inactive": "This account is not yet activated", | ||
"deactivated": "Account was deactivated", | ||
} |
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
Oops, something went wrong.