]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/views/writers.py
This is for the online users page. It has been disable. I am committing it so that...
[osqa.git] / forum / views / writers.py
index 74708d651b685dd310350f0042423fae10c63c0f..017914b793727c2465ae941d2d26b347c1ec0260 100644 (file)
@@ -4,7 +4,6 @@ import time, datetime, random
 import logging
 from django.core.files.storage import FileSystemStorage
 from django.shortcuts import render_to_response, get_object_or_404
-from django.contrib.auth.decorators import login_required
 from django.http import HttpResponseRedirect, HttpResponse, Http404
 from django.template import RequestContext
 from django.utils.html import *
@@ -110,9 +109,18 @@ def ask(request):
         'form' : form,
         }, context_instance=RequestContext(request))
 
-@login_required
 def edit_question(request, id):
-    question = get_object_or_404(Question, id=id)
+    #question = get_object_or_404(Question, id=id)
+    try:
+        question = Question.objects.get(id=id)
+    except:
+        if slug:
+            question = match_question_slug(slug)
+            if question is not None:
+                return HttpResponseRedirect(question.get_absolute_url())
+
+        raise Http404()
+
     if question.nis.deleted and not request.user.can_view_deleted_post(question):
         raise Http404
     if request.user.can_edit_post(question):
@@ -174,7 +182,6 @@ def _edit_question(request, question):
         #'tags' : _get_tags_cache_json()
     }, context_instance=RequestContext(request))
 
-@login_required
 def edit_answer(request, id):
     answer = get_object_or_404(Answer, id=id)
     if answer.deleted and not request.user.can_view_deleted_post(answer):