SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit d141b934 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Correct bug in change_password

parent dd192ab0
No related branches found
No related tags found
No related merge requests found
......@@ -4,13 +4,12 @@
{% block bodysup %}
{% if acknowledgement %}
{% if ack %}
<section>
<h1>Your SciPost password has been successfully changed</h1>
</section>
{% else %}
<section>
<h1>Change your SciPost password</h1>
<form action="{% url 'scipost:change_password' %}" method="post">
......@@ -26,6 +25,6 @@
<p>{{ errormessage }}</p>
{% endif %}
</section>
{% endif acknowledgement %}
{% endif %}
{% endblock bodysup %}
......@@ -304,11 +304,12 @@ def change_password(request):
return render(request, 'scipost/change_password.html', {'form': form, 'errormessage': 'Your new password entries must match'})
request.user.set_password(form.cleaned_data['password_new'])
request.user.save()
context = {'acknowledgement': True, 'form': PasswordChangeForm()}
return render(request, 'scipost/change_password.html', context)
ack = True
context = {'ack': True, 'form': form}
else:
form = PasswordChangeForm()
return render (request, 'scipost/change_password.html', {'form': form})
context = {'ack': False, 'form': form}
return render (request, 'scipost/change_password.html', context)
def reset_password_confirm(request, uidb64=None, token=None):
......
......@@ -126,8 +126,8 @@ class Report(models.Model):
weaknesses = models.TextField()
report = models.TextField()
requested_changes = models.TextField(verbose_name="requested changes")
formatting = models.SmallIntegerField(choices=QUALITY_SPEC, blank=True, default=0, verbose_name="Quality of paper formatting")
grammar = models.SmallIntegerField(choices=QUALITY_SPEC, blank=True, default=0, verbose_name="Quality of English grammar")
formatting = models.SmallIntegerField(choices=QUALITY_SPEC, blank=True, verbose_name="Quality of paper formatting")
grammar = models.SmallIntegerField(choices=QUALITY_SPEC, blank=True, verbose_name="Quality of English grammar")
recommendation = models.SmallIntegerField(choices=REPORT_REC)
date_invited = models.DateTimeField('date invited', blank=True, null=True)
invited_by = models.ForeignKey(Contributor, blank=True, null=True, related_name='invited_by')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment