1

block user going further after sign in

I have built module for user to agree terms of service, I have a decorator that I want to put it in deps/views.py I am trying to figure out where I should exactly use my decorator. I tried adding my decorator prior to following method but I didn't get the full effect. What I really want to do is once user click login (either open_id, google or django login) my decorator should get activate.

Here are the methods that I used but didn't really work.

#@requires_agreement('terms_of_service')
def show_signin_view(
SocialQA's avatar
265
SocialQA
asked 2013-12-01 08:50:04 -0500
Evgeny's avatar
13.2k
Evgeny
updated 2013-12-01 13:47:59 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

You should be able to create a custom registration form and assign dotted path to it via settings.py variable REGISTRATION_FORM (<- just look in the code for this keyword). I think this method will be simpler than using a decorator or modifying the code base.

Evgeny's avatar
13.2k
Evgeny
answered 2013-12-01 13:56:39 -0500
edit flag offensive 0 remove flag delete link

Comments

@Evgeny I am not really sure what you meant by "assign dotted path to it via". I looked for REGISTRATION_FORM in settings.py but that variable doesn't exist in settings.py

SocialQA's avatar SocialQA (2013-12-01 15:41:19 -0500) edit

Like `REGISTRATION_FORM = 'myapp.forms.MyRegistrationForm'`

Evgeny's avatar Evgeny (2013-12-01 16:14:41 -0500) edit
add a comment see more comments