First time here? Check out the FAQ!
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(

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
SocialQA's avatar
265
SocialQA
asked 11 years ago
Evgeny's avatar
13.2k
Evgeny
updated 11 years ago

Comments

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 11 years ago
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 (11 years ago)

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

Evgeny's avatar Evgeny (11 years ago)
see more comments