Can't open new form

What I’m trying to do:
I am using Anvil’s user log in service. Once the user has logged in or registered, the user should be sent to a new form in my app. However, this action is not happening.

What I’ve tried and what’s not working:
I have pasted a copy of my code that causes the error. I have included a print statement below the call to open the form. This print statement is sent to the console when I run my app. From my understanding, if a new form is being opened, this print statement shouldn’t be activated.

Code Sample:

 if current['ownership'] == "":
      current['ownership'] = "starting value"
      current['reserve_credits'] = 5000

email = current['email']
anvil.open_form('Ownership', user=email)
print("Shouldnt get here") ``` 

The form will be constructed, I believe, but not shown until all pending function calls are completed.