更新时间:2023-12-06 16:10:46
在文档,假定已经创建了用户个人资料,现在可以对其进行更新。您只需要一张支票
In the documentation it is assumed that userprofile was already created and now can be updated. You just need a check
# get and update user profile
try:
profile = instance.userprofile
except UserProfile.DoesNotExist:
profile = UserProfile()
if profile_data and company_name: