diff --git a/Chapter04/bookmarks/account/views.py b/Chapter04/bookmarks/account/views.py index 1427c7e..86f6a25 100644 --- a/Chapter04/bookmarks/account/views.py +++ b/Chapter04/bookmarks/account/views.py @@ -76,6 +76,8 @@ def edit(request): else: messages.error(request, 'Error updating your profile') else: + # Get or Create the user profile + Profile.objects.get_or_create(user=request.user) user_form = UserEditForm(instance=request.user) profile_form = ProfileEditForm(instance=request.user.profile) return render(request,