Skip to content

Commit

Permalink
Empty guestbooks dont crash
Browse files Browse the repository at this point in the history
  • Loading branch information
josven committed Aug 8, 2012
1 parent b7d1287 commit a733ad2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/accounts/views.py
Expand Up @@ -9,6 +9,7 @@
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib import messages
from django.contrib.humanize.templatetags.humanize import naturalday
from django.http import Http404

from apps.core.utils import render, get_datatables_records

Expand Down
1 change: 0 additions & 1 deletion apps/core/static/js/frontpage.js
Expand Up @@ -200,5 +200,4 @@ jQuery(document).ready(function() {

return false;
});

});
7 changes: 4 additions & 3 deletions apps/notifications/templatetags/notification_tags.py
Expand Up @@ -46,9 +46,10 @@ def get_notes_for_articlelist(context, queryset, user):
@register.assignment_tag(takes_context=True)
def get_notes_for_guestbook(context, queryset, user):

notifications = _get_notifications_for_qs(queryset, user)
queryset = _assign_notifications_on_qs(queryset, notifications)
new_notifications = _set_status_on_qs(notifications, 3)
if len(queryset) > 0:
notifications = _get_notifications_for_qs(queryset, user)
queryset = _assign_notifications_on_qs(queryset, notifications)
new_notifications = _set_status_on_qs(notifications, 3)

return queryset

Expand Down

0 comments on commit a733ad2

Please sign in to comment.