Skip to content
This repository has been archived by the owner on May 23, 2020. It is now read-only.

Commit

Permalink
fixed MultipleObjectsReturned
Browse files Browse the repository at this point in the history
  • Loading branch information
agusmakmun committed Jun 30, 2016
1 parent 0a3d9ad commit efeaed5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blog/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.core.mail import send_mail, BadHeaderError
from django.core.exceptions import ObjectDoesNotExist
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.template import loader, Context, RequestContext
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from blog.models import Entry, Tag, Author, Page
Expand Down Expand Up @@ -52,6 +52,7 @@ def tracking_hit_post(self):
view.save()
else: pass
except ValueError: pass
except MultipleObjectsReturned: pass
return Entry_Views.objects.filter(entry=entry).count()

def get_context_data(self, **kwargs):
Expand Down

0 comments on commit efeaed5

Please sign in to comment.