Skip to content

Commit 9912785

Browse files
Added Frontend
1 parent 1d727d0 commit 9912785

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

junction/profiles/views.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def profile(request):
3434
city = request.POST['city']
3535
contact_no = request.POST['contact_no']
3636
Profile.objects.create(user=request.user, city=city, contact_no=contact_no)
37-
return HttpResponseRedirect("/profile")
37+
return HttpResponseRedirect("/profiles")
38+
3839
elif request.method=="GET":
39-
return render(request, 'profiles/userprofile.html')
40+
return render(request, 'profiles/userprofile.html')

junction/templates/profiles/userprofile.html

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,14 @@ <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">
45+
<input autofocus="autofocus" name="contact_no" placeholder="Enter Your Contact No:" type="text" pattern="/(7|8|9)\d{9}/">
4646
</div>
4747
</div>
4848
<div class="form-group">
4949
<div class="col-lg-8 col-lg-offset-4">
5050
<button class="btn btn-primary" type="submit">
5151
Submit
5252
</button>
53-
</form>
54-
<form method="PUT">
55-
{% csrf_token %}
56-
&nbsp;
57-
<button class="btn btn-primary" type="submit">
58-
Update
59-
</button>
6053
</div>
6154
</div>
6255
</form>

0 commit comments

Comments
 (0)