Closed m-a-rahul closed 2 years ago
@m-a-rahul Usually when we have differentiating stuff b/w development & prod code, its better make use of a simple if-else rather than commenting stuff. What we can do is just make use of DEBUG
constant with if statement
and check whether if its set to true then implement the dev. code else prod. code.
Ok cool, got your suggestions. Will write back asap on completion of the changes requested.
Corresponding bug: Password Update Failure
Description:
Cause -> Since an AbstractUser model is configured on top of the default Users model the password update didn't work.
Fix -> Built a custom form on top SetPasswordForm
, which handles this functionality in the Django package
Corresponding bug: Email Check
Description:
Cause -> Django's default form doesn't inherit the functionality.
Fix -> Built a custom form on top PasswordResetForm
, which handles this functionality in the Django package
Screenshot:
Corresponding bug: Domain name in dev and prod env Description: Cause -> Django uses the sites framework to capture the domain Fix -> Wrote a condition to change the domain key value to,
localhost:800
when DEBUG=True
and classdeck.herokuapp.com
when DEBUG=False
Screenshot:
Fixes: #46
Description
Built custom templates with UI features relating to the ClassDeck's classic structure, on top of django.contrib.auth.views which offers default authentication feature by also handling form errors.
Type of change
How Has This Been Tested?
The feature has been tested across multiple times and is completely error free as we have just customised the default django package.
Describe if there is any unusual behaviour of your code(Write
NA
if there isn't)password_reset_email.html
line no 5: {{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
<- Production (commented)line no 6: http://localhost:8000{% url 'password_reset_confirm' uidb64=uid token=token %}
<- Development (active)Checklist:
Screenshots
Successfull Testcase
Invalid token
(If an attacker tries with another token and access the URL or if the same token is used twice)