Created
July 14, 2020 14:27
-
-
Save walison17/c14735ec1d5076e8075ab9cc3364bf5e to your computer and use it in GitHub Desktop.
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
def client_create(request): | |
if request.method == "POST": | |
user_form = UserForm(request.POST) | |
client_form = ClientForm(request.POST) | |
if user_form.is_valid() and client_form.is_valid(): | |
user = user_form.save() | |
client = client_form.save(commit=False) | |
client.user = user | |
client.save() | |
return redirect(client) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment