From dafbc8c0bfbb102b20af1d73a2b4613466ccda82 Mon Sep 17 00:00:00 2001 From: Yaumi Date: Sat, 31 Oct 2020 01:02:13 +0700 Subject: [PATCH 1/5] [GREEN] make reset password & send to email --- app/templates/app/base_reset.html | 130 ++++++++++++++++++ app/templates/password_reset.html | 18 +++ app/templates/password_reset_done.html | 14 ++ app/templates/password_reset_form.html | 17 +++ app/templates/password_reset_sent.html | 14 ++ app/urls.py | 12 ++ .../migrations/0009_user_is_email_verified.py | 18 +++ authentication/templates/login.html | 4 + digipus/__pycache__/settings.cpython-36.pyc | Bin 4132 -> 4159 bytes register/migrations/0001_initial.py | 27 ++++ 10 files changed, 254 insertions(+) create mode 100644 app/templates/app/base_reset.html create mode 100644 app/templates/password_reset.html create mode 100644 app/templates/password_reset_done.html create mode 100644 app/templates/password_reset_form.html create mode 100644 app/templates/password_reset_sent.html create mode 100644 authentication/migrations/0009_user_is_email_verified.py create mode 100644 register/migrations/0001_initial.py diff --git a/app/templates/app/base_reset.html b/app/templates/app/base_reset.html new file mode 100644 index 0000000..3fc86b8 --- /dev/null +++ b/app/templates/app/base_reset.html @@ -0,0 +1,130 @@ +{% load static %} + + + + + + Digipus + + + + + + + {% block title %}{% endblock %} + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + +
+ + + + + + +
+ {% block content %}{% endblock %} +
+ + +
+ + + +
+
+ +
+
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/templates/password_reset.html b/app/templates/password_reset.html new file mode 100644 index 0000000..1489085 --- /dev/null +++ b/app/templates/password_reset.html @@ -0,0 +1,18 @@ +{% extends 'app/base_reset.html' %} +{% block title %}Reset Password{% endblock%} +{% block content %} + + +

Reset Password

+

+

Forgotten your password ? Enter email address below, and we'll email instructions for setting a new one.

+ +
+
+ {% csrf_token %} + {{ form.as_p }} + +
+
+ +{% endblock %} \ No newline at end of file diff --git a/app/templates/password_reset_done.html b/app/templates/password_reset_done.html new file mode 100644 index 0000000..d021c57 --- /dev/null +++ b/app/templates/password_reset_done.html @@ -0,0 +1,14 @@ + +{% extends 'app/base_reset.html' %} +{% block title %}Password reset complete{% endblock%} +{% block content %} + + +

Password reset complete

+

+

Your password has been set. You may go ahead and log in now.

+ +Log in + + +{% endblock %} \ No newline at end of file diff --git a/app/templates/password_reset_form.html b/app/templates/password_reset_form.html new file mode 100644 index 0000000..73e68f5 --- /dev/null +++ b/app/templates/password_reset_form.html @@ -0,0 +1,17 @@ +{% extends 'app/base_reset.html' %} +{% block title %}Enter new password{% endblock%} +{% block content %} + + +

Enter new password

+

+ +
+
+ {% csrf_token %} + {{ form.as_p }} + +
+
+ +{% endblock %} \ No newline at end of file diff --git a/app/templates/password_reset_sent.html b/app/templates/password_reset_sent.html new file mode 100644 index 0000000..12542b5 --- /dev/null +++ b/app/templates/password_reset_sent.html @@ -0,0 +1,14 @@ + +{% extends 'app/base_reset.html' %} +{% block title %}Password reset sent{% endblock%} +{% block content %} + + +

Password reset sent

+

+

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.

+ + +{% endblock %} \ No newline at end of file diff --git a/app/urls.py b/app/urls.py index a8c7281..8f0d046 100644 --- a/app/urls.py +++ b/app/urls.py @@ -41,4 +41,16 @@ urlpatterns = [ path("password_success/", views.password_success, name="password_success"), path("given-rating/", views.see_given_rating, name="see_given_rating"), path("submit-visitor/", SubmitVisitorView.as_view(), name="submit-visitor"), + path("reset_password/", + auth_views.PasswordResetView.as_view(template_name="password_reset.html"), + name="reset_password"), + path("reset_password_sent/", + auth_views.PasswordResetDoneView.as_view(template_name="password_reset_sent.html"), + name="password_reset_done"), + path("reset///", + auth_views.PasswordResetConfirmView.as_view(template_name="password_reset_form.html"), + name="password_reset_confirm"), + path("reset_password_complete/", + auth_views.PasswordResetCompleteView.as_view(template_name="password_reset_done.html"), + name="password_reset_complete"), ] diff --git a/authentication/migrations/0009_user_is_email_verified.py b/authentication/migrations/0009_user_is_email_verified.py new file mode 100644 index 0000000..a8a62be --- /dev/null +++ b/authentication/migrations/0009_user_is_email_verified.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1 on 2020-10-30 16:27 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('authentication', '0008_user_is_subscribing_to_material_comments'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='is_email_verified', + field=models.BooleanField(default=False), + ), + ] diff --git a/authentication/templates/login.html b/authentication/templates/login.html index 9fac8e2..e577a99 100644 --- a/authentication/templates/login.html +++ b/authentication/templates/login.html @@ -65,6 +65,10 @@ Belum mendaftar? klik di sini
+ + Lupa password? klik di sini + +
Ingin jadi kontributor? klik di sini diff --git a/digipus/__pycache__/settings.cpython-36.pyc b/digipus/__pycache__/settings.cpython-36.pyc index 1cf78ac5dc695e4dca1c09a4b10db034aec54534..f90737f5493bb81ce1a0ac50e7dda3b442006d25 100644 GIT binary patch delta 672 zcmYk4&u`LT7{}WN1sRMbX3paj6_HU9{4uvV2ZCCO007*9U!z|rRU_S5hCectCy+K=#~xV&rjY`zwFl|##q*EY)=4Qah8wg=PUvKF=|mN{M%nyogia}49B zj>6K8SZfXDY|}Or0}od$6boxXD{tUn(?2;870RNx*KAeEOb`dEQM>P|!I@j!wI> wkspogjGwOB>(Q>}^7g(TTQM!@8)|fQ3j5q2o|1a&{YfoM$D$E7F}fq{KW<{n#Q*>R delta 562 zcmdn5utY)Gn3tF9_`HeniJ}Y)j~S4F0Fdnf#KmbFmA5n2r#Pj!WHJItS1{?8$(YU( zrIg|xrJUjsrIMl;r3%DqK&+n1p2eTy2_!YZq-Kg2kgb*C4J5Twd@@<1bW&MTd{g{V z{Ck!|qGE)*uGV}BFLW@(297{@yGLuS6QiC&dGjkG)GD|AMAS&{Us_Z~ob+Bpm&CJWp zEzR{w%}X!IKxnWBY0$-{!8t!SH$N``>I#Go2apbBY&!f(b5n~llVMsWzu~;jcx&~S z-`6q3JJcuG)z@4XYlJ3qHHFSA%bB{My Date: Sat, 31 Oct 2020 01:23:02 +0700 Subject: [PATCH 2/5] [REFACTOR] html reset form --- app/templates/password_reset_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/password_reset_form.html b/app/templates/password_reset_form.html index 73e68f5..d48edae 100644 --- a/app/templates/password_reset_form.html +++ b/app/templates/password_reset_form.html @@ -3,7 +3,7 @@ {% block content %} -

Enter new password

+

Enter new password



-- GitLab From e720cd27107f9cdf5d7e27f3dea5fc0619c0ac8b Mon Sep 17 00:00:00 2001 From: Yaumi Alfadha Date: Sat, 31 Oct 2020 01:26:44 +0700 Subject: [PATCH 3/5] Delete 0009_user_is_email_verified.py --- .../migrations/0009_user_is_email_verified.py | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 authentication/migrations/0009_user_is_email_verified.py diff --git a/authentication/migrations/0009_user_is_email_verified.py b/authentication/migrations/0009_user_is_email_verified.py deleted file mode 100644 index a8a62be..0000000 --- a/authentication/migrations/0009_user_is_email_verified.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.1 on 2020-10-30 16:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('authentication', '0008_user_is_subscribing_to_material_comments'), - ] - - operations = [ - migrations.AddField( - model_name='user', - name='is_email_verified', - field=models.BooleanField(default=False), - ), - ] -- GitLab From 752c4d22babf60de0a9cdf020e9d329b88d4abb9 Mon Sep 17 00:00:00 2001 From: Yaumi Date: Sat, 31 Oct 2020 01:31:08 +0700 Subject: [PATCH 4/5] delete file migrations --- app/templates/password_reset_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/password_reset_form.html b/app/templates/password_reset_form.html index d48edae..73e68f5 100644 --- a/app/templates/password_reset_form.html +++ b/app/templates/password_reset_form.html @@ -3,7 +3,7 @@ {% block content %} -

Enter new password

+

Enter new password



-- GitLab From e9a0c90b07e7371fc9c78c469087d27eeb22963a Mon Sep 17 00:00:00 2001 From: Yaumi Date: Sat, 31 Oct 2020 08:46:05 +0700 Subject: [PATCH 5/5] merge to master --- app/urls.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/urls.py b/app/urls.py index d93f7cc..cb90ceb 100644 --- a/app/urls.py +++ b/app/urls.py @@ -53,8 +53,5 @@ urlpatterns = [ path("reset_password_complete/", auth_views.PasswordResetCompleteView.as_view(template_name="password_reset_done.html"), name="password_reset_complete"), - path(r'subscribe/', views.subscribe, name='subscribe'), - path(r'subscribeform/', views.subscribeform, name='subscribeform'), - path(r'subscription_confirmation/', views.subscription_confirmation, name='subscription_confirmation'), - + ] -- GitLab