Userena:如何获取“编辑个人资料”中的字段保存 [英] Userena: How can I get the fields in "edit profile" to save
问题描述
- 查看个人资料(数据正确)
- 编辑个人资料,然后点击
- 查看个人资料(新保存的信息已经消失)
- 编辑个人资料,只填写在最喜欢的小吃字段中(重定向到查看配置文件页面,显示最喜欢的小吃)
- 该配置文件现在正常运行,可以像普通的一样进行编辑和保存。
为什么编辑个人资料页面的正常功能取决于我是否填写了最爱小吃字段?请注意,最喜欢的零食在models.py中定义,如 userena教程。
任何想法?
我发现问题。看起来我可以允许一个空白字段进行以下更改。
旧代码
favourite_snack = models.CharField(_('favorite snack'),
max_length = 5)
新代码
favourite_snack = models.CharField(_('favorite snack'),
max_length = 5,blank = True)
I have a user I have successfully registered in userena. When I view the profile, the information entered in during signup is properly displayed. I click "edit profile" and am presented with the form. I then noticed this behavior:
- View profile (data is correct)
- Edit profile then click save (redirected to the same form with all information still filled in)
- View profile (newly saved information is gone)
- Edit profile and only fill in the "favorite snack" field (redirected to the "view profile" page with the "favorite snack" now showing)
- The profile now behaves normally and can be edited and saved like normal.
Why is the proper functioning of the edit profile page dependent on whether I have the "favorite snack" field filled in? Note that "favorite snack" is defined in models.py as outlined in the userena tutorial.
Any ideas?
I found the problem. It looks like I can allow for a blank field with the following change.
Old Code:
favourite_snack = models.CharField(_('favourite snack'),
max_length=5)
New Code:
favourite_snack = models.CharField(_('favourite snack'),
max_length=5, blank=True)
这篇关于Userena:如何获取“编辑个人资料”中的字段保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!