From 5669ecb3f9a7d3c16fbd4bd00b7b448fbb275181 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Mon, 23 Feb 2015 16:08:21 +0530 Subject: specified date format and redirected --- tbc/templates/tbc/update-profile.html | 31 +++++++++++++++++++++++++++++++ tbc/views.py | 4 ++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 tbc/templates/tbc/update-profile.html diff --git a/tbc/templates/tbc/update-profile.html b/tbc/templates/tbc/update-profile.html new file mode 100644 index 0000000..d1731bb --- /dev/null +++ b/tbc/templates/tbc/update-profile.html @@ -0,0 +1,31 @@ +{% extends 'base.html' %} +{% block content %} +{% if profile %} +
+
+ × +

Please update your profile first and then proceed.

+
+
+
+{% endif %} +
+

Update Your Profile

+
+
+ {% csrf_token %} + {{ form.as_p }} + {{ form.errors }} +
+ +
+
+{% endblock %} + +{% block script %} + +{% endblock %} diff --git a/tbc/views.py b/tbc/views.py index f715e3e..deb5123 100755 --- a/tbc/views.py +++ b/tbc/views.py @@ -272,7 +272,7 @@ def UpdateProfile(request): return HttpResponseRedirect('/') else: context['form'] = form - return render_to_response('tbc/profile.html', context) + return render_to_response('tbc/update-profile.html', context) else: form = UserProfileForm() form.initial['about'] = user_profile.about @@ -284,7 +284,7 @@ def UpdateProfile(request): form.initial['phone_no'] = user_profile.phone_no form.initial['about_proj'] = user_profile.about_proj context['form'] = form - return render_to_response('tbc/profile.html', context) + return render_to_response('tbc/update-profile.html', context) def UserLogout(request): user = request.user -- cgit