Skip to content

Commit d94da6d

Browse files
committed
fix : move question bug
1 parent 237051e commit d94da6d

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

static/website/templates/get-question.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ <h5>Move the question to:</h5>
262262
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
263263
<select id="id_category" class="form-control">
264264
{%for a_foss in category %}
265-
<option value={{a_foss.foss}}>{{a_foss.foss}}</option>
265+
<option value="{{a_foss.foss}}">{{a_foss.foss}}</option>
266266
{% endfor %}
267267
</select>
268268
</div>
@@ -284,8 +284,8 @@ <h5>Move the question to:</h5>
284284
</div> <!-- /.row -->
285285
<hr>
286286
<div class="pull-right">
287-
<a id="question-details-ok" class="btn btn-sm btn-success hideme" data-qid={{ question.id }} href="#">Ok</a>
288-
<a class="btn btn-sm btn-default" data-dismiss="modal" href="#">Close</a>
287+
<a id="question-details-ok" class="btn btn-sm btn-success hideme" data-qid={{ question.id }} onclick ="window.location.reload()">Ok</a>
288+
<a class="btn btn-sm btn-default" data-dismiss="modal" onclick ="window.location.reload()">Close</a>
289289
</div>
290290
<div class="clearfix"></div>
291291
</div> <!-- /.modal-body -->

website/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def get_question(request, question_id=None, pretty_url=None):
7373
question = get_object_or_404(Question, id=question_id)
7474
pretty_title = prettify(question.title)
7575
category = FossCategory.objects.all().order_by('foss')
76+
7677
if pretty_url != pretty_title:
7778
return HttpResponseRedirect('/question/' + question_id + '/' + pretty_title)
7879
answers = question.answer_set.all()
@@ -435,7 +436,9 @@ def ajax_details_update(request):
435436
if request.method == 'POST':
436437
qid = request.POST['qid']
437438
category = request.POST['category']
439+
category = category.replace(' ', '-')
438440
tutorial = request.POST['tutorial']
441+
tutorial = tutorial.replace(' ', '-')
439442
minute_range = request.POST['minute_range']
440443
second_range = request.POST['second_range']
441444
question = get_object_or_404(Question, pk=qid)

0 commit comments

Comments
 (0)