File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ def profile(request):
34
34
city = request .POST ['city' ]
35
35
contact_no = request .POST ['contact_no' ]
36
36
Profile .objects .create (user = request .user , city = city , contact_no = contact_no )
37
- return HttpResponseRedirect ("/profile" )
37
+ return HttpResponseRedirect ("/profiles" )
38
+
38
39
elif request .method == "GET" :
39
- return render (request , 'profiles/userprofile.html' )
40
+ return render (request , 'profiles/userprofile.html' )
Original file line number Diff line number Diff line change @@ -42,21 +42,14 @@ <h2 class="text-center">Edit Profile</h2>
42
42
< div class ="form-group ">
43
43
< label for ="contact " class ="col-lg-4 control-label "> Contact :</ label >
44
44
< 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}/ " >
46
46
</ div >
47
47
</ div >
48
48
< div class ="form-group ">
49
49
< div class ="col-lg-8 col-lg-offset-4 ">
50
50
< button class ="btn btn-primary " type ="submit ">
51
51
Submit
52
52
</ button >
53
- </ form >
54
- < form method ="PUT ">
55
- {% csrf_token %}
56
-
57
- < button class ="btn btn-primary " type ="submit ">
58
- Update
59
- </ button >
60
53
</ div >
61
54
</ div >
62
55
</ form >
You can’t perform that action at this time.
0 commit comments