Skip to content

Instantly share code, notes, and snippets.

@jqn
Created April 7, 2020 16:20
Show Gist options
  • Save jqn/b31ad8109b0b50d016ec89233d20fca7 to your computer and use it in GitHub Desktop.
Save jqn/b31ad8109b0b50d016ec89233d20fca7 to your computer and use it in GitHub Desktop.
super_tuber register as tutor
class TutorRegister(CreateView):
model = TUser
form_class = TutorUserSignUpForm
template_name = 'FindTutors/tutor_signup.html' # correct form HTML
def form_valid(self, form):
user = form.save(commit=False)
user.is_tutor = True
user.save()
return redirect('/home/tutors/') # Go back to the table of tutors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment