Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. def auth_decorator(func):
  2.     user = func
  3.     login_user = authenticate(username=user.username, password=form.cleaned_data['password1'])
  4.  
  5.     if user is not None:
  6.         profile = UserProfile.objects.filter(user=user).get()
  7.         if not profile.paid_user:
  8.             return redirect(site)
  9.         else:
  10.             return func
  11.     else:
  12.         return func
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement