diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc new file mode 100644 index 0000000..e981af5 Binary files /dev/null and b/core/__pycache__/forms.cpython-311.pyc differ diff --git a/core/__pycache__/tokens.cpython-311.pyc b/core/__pycache__/tokens.cpython-311.pyc new file mode 100644 index 0000000..027eea5 Binary files /dev/null and b/core/__pycache__/tokens.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index 9977bb1..736280a 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index a0a46b2..1a45eb4 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/forms.py b/core/forms.py new file mode 100644 index 0000000..be81d44 --- /dev/null +++ b/core/forms.py @@ -0,0 +1,22 @@ +from django import forms +from django.contrib.auth.models import User +from django.contrib.auth.forms import UserCreationForm + +class SignupForm(UserCreationForm): + email = forms.EmailField(required=True, help_text="Required. A valid email address.") + terms_accepted = forms.BooleanField( + required=True, + label="I accept the standard terms and conditions", + widget=forms.CheckboxInput(attrs={'class': 'form-check-input'}) + ) + + class Meta(UserCreationForm.Meta): + model = User + fields = UserCreationForm.Meta.fields + ('email',) + + def save(self, commit=True): + user = super().save(commit=False) + user.email = self.cleaned_data["email"] + if commit: + user.save() + return user diff --git a/core/templates/core/emails/activation_email.html b/core/templates/core/emails/activation_email.html new file mode 100644 index 0000000..5252eee --- /dev/null +++ b/core/templates/core/emails/activation_email.html @@ -0,0 +1,14 @@ +{% autoescape off %} +Hi {{ user.username }}, + +Welcome to Referral Rewards! + +Please click on the link below to confirm your registration and activate your account: + +{{ protocol }}://{{ domain }}{% url 'activate' uidb64=uid token=token %} + +If you did not sign up for this account, please ignore this email. + +Best regards, +The Referral Rewards Team +{% endautoescape %} \ No newline at end of file diff --git a/core/templates/core/emails/password_reset_email.html b/core/templates/core/emails/password_reset_email.html new file mode 100644 index 0000000..282c4cf --- /dev/null +++ b/core/templates/core/emails/password_reset_email.html @@ -0,0 +1,15 @@ +{% autoescape off %} +You're receiving this email because you requested a password reset for your user account at {{ site_name }}. + +Please go to the following page and choose a new password: + +{% block reset_link %} +{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %} +{% endblock %} + +Your username, in case you've forgotten: {{ user.get_username }} + +Thanks for using our site! + +The {{ site_name }} team +{% endautoescape %} diff --git a/core/templates/core/emails/password_reset_subject.txt b/core/templates/core/emails/password_reset_subject.txt new file mode 100644 index 0000000..fc16b16 --- /dev/null +++ b/core/templates/core/emails/password_reset_subject.txt @@ -0,0 +1 @@ +Password reset on {{ site_name }} diff --git a/core/templates/core/login.html b/core/templates/core/login.html index a9e978a..34416b3 100644 --- a/core/templates/core/login.html +++ b/core/templates/core/login.html @@ -27,10 +27,14 @@ -
Your password has been set. You may go ahead and log in now.
+Please enter your new password twice so we can verify you typed it correctly.
+We've emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly.
+If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder.
+ +Enter your email address and we'll send you a link to reset your password.
+