Fix copy, fix mutation fields

This commit is contained in:
Christian Cueni 2019-10-23 13:22:01 +02:00
parent 148b2cae3d
commit 981b99ced7
5 changed files with 7 additions and 7 deletions

View File

@ -7,7 +7,7 @@
{% block body %} {% block body %}
<div class="reset"> <div class="reset">
<h2 class="reset__heading">{% trans 'Setzen Sie Ihr neues Passwort' %}</h2> <h2 class="reset__heading">{% trans 'Setzen Sie Ihr neues Passwort' %}</h2>
<p class="reset__text">{% trans 'Kein Problem! Geben Sie Ihre E-Mail-Adresse ein und erhalten Sie weitere Anweisungen.' %}</p> <p class="reset__text">{% trans 'Das Passwort muss Grossbuchstaben, Zahlen und Sonderzeichen beinhalten' %}</p>
<form method="post" class="mt-1 reset__form"> <form method="post" class="mt-1 reset__form">
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {{ form.as_p }}

View File

@ -6,7 +6,7 @@
{% block body %} {% block body %}
<div class="reset"> <div class="reset">
<h2 class="reset__heading">{% trans 'Sie haben es geschafft' %}</h2> <h2 class="reset__heading">{% trans 'Sie haben es geschafft' %}</h2>
<p class="reset__text">% trans 'Ihr Passwort wurde erfolgreich gespeichert. Sie können sich nun anmelden.' %}</p> <p class="reset__text">{% trans 'Ihr Passwort wurde erfolgreich gespeichert. Sie können sich nun anmelden.' %}</p>
<p class="reset__text"><a href="/login">{% trans 'Jetzt anmelden' %}</a></p> <p class="reset__text"><a href="/login">{% trans 'Jetzt anmelden' %}</a></p>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -7,7 +7,7 @@
{% block body %} {% block body %}
<div class="reset"> <div class="reset">
<h2 class="reset__heading">{% trans 'Geben Sie ein persönliches Passwort ein:' %}</h2> <h2 class="reset__heading">{% trans 'Geben Sie ein persönliches Passwort ein:' %}</h2>
<p class="reset__text">{% trans 'Kein Problem! Geben Sie Ihre E-Mail-Adresse ein und erhalten Sie weitere Anweisungen.' %}</p> <p class="reset__text">{% trans 'Das Passwort muss Grossbuchstaben, Zahlen und Sonderzeichen beinhalten.' %}</p>
<form method="post" class="mt-1 reset__form"> <form method="post" class="mt-1 reset__form">
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {{ form.as_p }}

View File

@ -14,7 +14,7 @@ from core.views import SetPasswordView
from registration.models import License from registration.models import License
from registration.serializers import RegistrationSerializer from registration.serializers import RegistrationSerializer
from users.models import User, Role, UserRole, SchoolClass from users.models import User, Role, UserRole, SchoolClass
from users.mutations_public import MutationError, FieldError from users.mutations_public import MutationError, PublicFieldError
class Registration(relay.ClientIDMutation): class Registration(relay.ClientIDMutation):
@ -73,7 +73,7 @@ class Registration(relay.ClientIDMutation):
for key, value in serializer.errors.items(): for key, value in serializer.errors.items():
error = MutationError(field=key, errors=[]) error = MutationError(field=key, errors=[])
for field_error in serializer.errors[key]: for field_error in serializer.errors[key]:
error.errors.append(FieldError(code=field_error.code)) error.errors.append(PublicFieldError(code=field_error.code))
errors.append(error) errors.append(error)

View File

@ -14,13 +14,13 @@ from django.contrib.auth import authenticate, login
from graphene import relay from graphene import relay
class FieldError(graphene.ObjectType): class PublicFieldError(graphene.ObjectType):
code = graphene.String() code = graphene.String()
class MutationError(graphene.ObjectType): class MutationError(graphene.ObjectType):
field = graphene.String() field = graphene.String()
errors = graphene.List(FieldError) errors = graphene.List(PublicFieldError)
class Login(relay.ClientIDMutation): class Login(relay.ClientIDMutation):