django allauth:重定向无效密码

时间:2017-07-11 06:59:45

标签: django redirect django-allauth

我有一个调用allauth注册视图的自定义页面(custom_passcheck.html)

<form action="{% url 'account_signup' %}" method="post" class="form">

            {% csrf_token %}
            <BR>
            <BR>
            <BR>
            <center>
                <div class=signuponepage>
                    <div class=sign-up>
                        <div class=signup-box>
                            <div class="form-element email-address">

                                <label id="email-address-label">
                                    <strong>
                                        Create a password (it must be 6 characters long)
                                    </strong>
                                    <input type="hidden" name="username" value="{{ pemail }}">
                                    <input type="hidden" name="email" value="{{ email }}">
                                    <input type="text" maxlength="19" name="password1" value="" placeholder="Password">
                                    <input type="text" maxlength="19" name="password2" value="" placeholder="Password (again)">
                                </label>

                            </div>
                            <div class="form-element nextstep-button">
                                {% buttons %}
                                    <button type="submit" class="btn btn-primary btn-sm">
                                        Finish {% bootstrap_icon "chevron-right" %}
                                    </button>
                                {% endbuttons %}
                            </div>
                        </div>
                    </div>
                </div>
            </center>
        </form>

现在,如果用户输入的密码少于6个字符,则会引发错误并将用户重定向到allauth注册页面(/ account / signup)

问题:如何重定向到(/ account / signup),如何在保留POST数据的同时重定向到自定义页面(custom_passcheck.html)

0 个答案:

没有答案