You might be able to simplify this logic:

```python
if user is None:
  user = User(key_name=email,
              email=email,
              url_nonce=os.urandom(32).encode("hex"))
user.occupation = occupation
user.employer = employer
user.phone = phone
user.target = target
user.put()

return user
```