Spaces:
Running
Running
Commit ·
e3a5295
1
Parent(s): 5288c20
edit bug fixes
Browse files- db.sqlite3 +0 -0
- polls/templates/polls/create.html +1 -1
- polls/views.py +4 -1
db.sqlite3
CHANGED
|
Binary files a/db.sqlite3 and b/db.sqlite3 differ
|
|
|
polls/templates/polls/create.html
CHANGED
|
@@ -67,7 +67,7 @@
|
|
| 67 |
|
| 68 |
</div>
|
| 69 |
<span id="add_option" onclick="create_choice()">Add option</span>
|
| 70 |
-
<button class="create_btn" onclick="create_question()">Create</button>
|
| 71 |
|
| 72 |
</div>
|
| 73 |
</div>
|
|
|
|
| 67 |
|
| 68 |
</div>
|
| 69 |
<span id="add_option" onclick="create_choice()">Add option</span>
|
| 70 |
+
<button class="create_btn" onclick="create_question()">{{ q|yesno:"Update,Create" }}</button>
|
| 71 |
|
| 72 |
</div>
|
| 73 |
</div>
|
polls/views.py
CHANGED
|
@@ -146,7 +146,10 @@ def create(request):
|
|
| 146 |
context['q']=get_object_or_404(Question,pk=request.GET['q'])
|
| 147 |
# "No such question exists"
|
| 148 |
|
| 149 |
-
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
# get themes
|
| 152 |
themes=ThemeColor.objects.all()
|
|
|
|
| 146 |
context['q']=get_object_or_404(Question,pk=request.GET['q'])
|
| 147 |
# "No such question exists"
|
| 148 |
|
| 149 |
+
if context['q'].author!=request.user:
|
| 150 |
+
# they don't have access to this question
|
| 151 |
+
raise Http404("this question does't belongs to you.")
|
| 152 |
+
|
| 153 |
|
| 154 |
# get themes
|
| 155 |
themes=ThemeColor.objects.all()
|