summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2017-11-03 18:52:38 +0530
committerGitHub2017-11-03 18:52:38 +0530
commit6b8ecc840698b7793c1d8fd350da8c85f1b02b7d (patch)
treebdc30451cb826281e6d346321c56c57f549a6dff /yaksh/views.py
parent840c00b9e939d2b33058d236ef4170923e0a018b (diff)
parent3ab5cf0783159aab349ef69db7500a42ad2e719c (diff)
downloadonline_test-6b8ecc840698b7793c1d8fd350da8c85f1b02b7d.tar.gz
online_test-6b8ecc840698b7793c1d8fd350da8c85f1b02b7d.tar.bz2
online_test-6b8ecc840698b7793c1d8fd350da8c85f1b02b7d.zip
Merge pull request #375 from prathamesh920/edit_profile_bug_fix
Edit Profile Bug Fix
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index b4cb844..c50ba33 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -1406,7 +1406,6 @@ def view_profile(request):
@login_required
-@has_profile
@email_verified
def edit_profile(request):
""" edit profile details facility for moderator and students """
@@ -1418,7 +1417,10 @@ def edit_profile(request):
else:
template = 'user.html'
context = {'template': template}
- profile = Profile.objects.get(user_id=user.id)
+ try:
+ profile = Profile.objects.get(user_id=user.id)
+ except Profile.DoesNotExist:
+ profile = None
if request.method == 'POST':
form = ProfileForm(request.POST, user=user, instance=profile)