Commits

Sergio Oliveira committed fd6f76b Draft

Doing the thread query inside a try

Comments (0)

Files changed (1)

colab/super_archives/views.py

 
     try:
         first_message = queries.get_first_message_in_thread(mailinglist, thread_token)
+        thread = Thread.objects.get(
+            mailinglist__name=mailinglist, 
+            subject_token=thread_token
+        )   
     except ObjectDoesNotExist:
         raise Http404 
     order_by = request.GET.get('order')
         total_votes += email.votes_count()
 
     # Update relevance score
-    query = Thread.objects.filter(mailinglist__name=mailinglist)
-    thread = query.get(subject_token=thread_token)   
     thread.update_score()
  
     template_data = {