Created
April 7, 2020 16:20
-
-
Save jqn/b31ad8109b0b50d016ec89233d20fca7 to your computer and use it in GitHub Desktop.
super_tuber register as tutor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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