Require authentication to checkout (optionally)

Create issue
Issue #502 resolved
Former user created an issue

With this patch it's possible to require authentication before checkout. It also fixes a bug with password comparison in registration form, which allowed to create account with differrent passwords given.

Reported by emes

Comments (3)

  1. Former user Account Deleted

    This patch addresses all three issues. The username generation change is a part of #376 patch, which has been added by mistake here.

    Regarding the decorator, we need to check for a configuration variable before making decision if user should be redirected. Doing this in urls.py would require an application restart, wouldn't it? Anyway, I'm strongly against putting excessive code into urls mapping.

  2. Former user Account Deleted

    Good catch on the password comparison. I've applied the fix in [1408].

    There are a few problems with the patch:

    • The change to activation_email.txt will produce URLs with no domain name.
    • There is untranslated text in authentication_required.html.
    • Don't change how the username is generated in satchmo/accounts/forms.py. The username should be short because it is used in the login forms of other apps, such as the admin site.

    Lastly, what in this patch can't be more flexibly implemented by decorators in the URLconf? login_required is a Django built-in, and it is trivial to create a decorator that redirects to a specific template.

  3. Log in to comment