Commits

luke  committed a7fa308

[project @ 346]
Fixed bug when moving/deleting the last messages in a box.

  • Participants
  • Parent commits 766abe6

Comments (0)

Files changed (1)

File cciw/cciwmain/views/members.py

         message_count = member.messages_received.filter(box=box).count()
         page = request.GET.get('page', 1)
         last_page = int(math.ceil(float(message_count)/settings.MEMBERS_PAGINATE_MESSAGES_BY))
+        last_page = max(last_page, 1)
         if page > last_page:
             # User may have deleted/moved everything on the last page,
             # so need to redirect to avoid a 404