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 @@ ...@@ -4,13 +4,12 @@
{% block bodysup %} {% block bodysup %}
{% if acknowledgement %} {% if ack %}
<section> <section>
<h1>Your SciPost password has been successfully changed</h1> <h1>Your SciPost password has been successfully changed</h1>
</section> </section>
{% else %} {% else %}
<section> <section>
<h1>Change your SciPost password</h1> <h1>Change your SciPost password</h1>
<form action="{% url 'scipost:change_password' %}" method="post"> <form action="{% url 'scipost:change_password' %}" method="post">
...@@ -26,6 +25,6 @@ ...@@ -26,6 +25,6 @@
<p>{{ errormessage }}</p> <p>{{ errormessage }}</p>
{% endif %} {% endif %}
</section> </section>
{% endif acknowledgement %} {% endif %}
{% endblock bodysup %} {% endblock bodysup %}
...@@ -304,11 +304,12 @@ def change_password(request): ...@@ -304,11 +304,12 @@ def change_password(request):
return render(request, 'scipost/change_password.html', {'form': form, 'errormessage': 'Your new password entries must match'}) 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.set_password(form.cleaned_data['password_new'])
request.user.save() request.user.save()
context = {'acknowledgement': True, 'form': PasswordChangeForm()} ack = True
return render(request, 'scipost/change_password.html', context) context = {'ack': True, 'form': form}
else: else:
form = PasswordChangeForm() 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): def reset_password_confirm(request, uidb64=None, token=None):
......
...@@ -126,8 +126,8 @@ class Report(models.Model): ...@@ -126,8 +126,8 @@ class Report(models.Model):
weaknesses = models.TextField() weaknesses = models.TextField()
report = models.TextField() report = models.TextField()
requested_changes = models.TextField(verbose_name="requested changes") requested_changes = models.TextField(verbose_name="requested changes")
formatting = models.SmallIntegerField(choices=QUALITY_SPEC, blank=True, default=0, verbose_name="Quality of paper formatting") formatting = models.SmallIntegerField(choices=QUALITY_SPEC, blank=True, verbose_name="Quality of paper formatting")
grammar = models.SmallIntegerField(choices=QUALITY_SPEC, blank=True, default=0, verbose_name="Quality of English grammar") grammar = models.SmallIntegerField(choices=QUALITY_SPEC, blank=True, verbose_name="Quality of English grammar")
recommendation = models.SmallIntegerField(choices=REPORT_REC) recommendation = models.SmallIntegerField(choices=REPORT_REC)
date_invited = models.DateTimeField('date invited', blank=True, null=True) date_invited = models.DateTimeField('date invited', blank=True, null=True)
invited_by = models.ForeignKey(Contributor, blank=True, null=True, related_name='invited_by') 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