Skip to content

Commit 5951407

Browse files
Exception Handled
1 parent 0316b70 commit 5951407

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

junction/profiles/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def dashboard(request):
3131
@login_required
3232
def profile(request):
3333
if request.method == "POST":
34-
city = request.POST['city']
35-
contact_no = request.POST['contact_no']
34+
city = request.POST.get('city')
35+
contact_no = request.POST.get('contact_no')
3636
Profile.objects.create(user=request.user, city=city, contact_no=contact_no)
3737
return HttpResponseRedirect("/profiles")
3838

junction/templates/profiles/userprofile.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ <h2 class="text-center">Edit Profile</h2>
4242
<div class="form-group">
4343
<label for="contact" class="col-lg-4 control-label"> Contact :</label>
4444
<div class="col-lg-8">
45-
<input autofocus="autofocus" name="contact_no" placeholder="Enter Your Contact No:" type="text" pattern="/(7|8|9)\d{9}/">
45+
<input autofocus="autofocus" name="contact_no" placeholder="Enter Your Contact No:" type="text" pattern="\d{10}">
4646
</div>
4747
</div>
4848
<div class="form-group">

0 commit comments

Comments
 (0)