Skip to content

Commit

Permalink
Update add_profile view to pass existing profile data to template
Browse files Browse the repository at this point in the history
- Modify 'data' parameter in render context to pass existing profile
- Ensure template receives profile information when re-rendering after validation error
  • Loading branch information
NagiPragalathan committed Feb 10, 2025
1 parent 7c0a1d1 commit b9a3d1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/views/Profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def add_profile(request, username, dashboard=0):
chapters = ChapterName.objects.all()

return render(request, 'Profile/add_profile.html', {
'data': None,
'data': profile,
'chapter': chapters,
'is_admin': is_admin,
'error': True,
Expand All @@ -119,6 +119,7 @@ def add_profile(request, username, dashboard=0):
})



def add_contact_details(request, username, dashboard=0):
if request.method == 'POST':
user = User.objects.get(username=username)
Expand Down

0 comments on commit b9a3d1f

Please sign in to comment.