Commits

Matías Herranz  committed 40c779d Draft

Another fix in views

  • Participants
  • Parent commits 9d15663

Comments (0)

Files changed (1)

File postman/views.py

             try:
                 # handle the case when something like u'|u|s|e|r|1|0|' comes in
                 # request.POST['recipients']
-                aux = post_recipients.replace('|', '')
-                users = [User.objects.get(username=aux),]
-
-                request.POST['recipients'] = ','.join([user.username for user in users])
+                request.POST['recipients'] = post_recipients.replace('|', '')
+                #request.POST['recipients'] = User.objects.get(username=aux).username
             except:
                 pass
 
     tpks = request.POST.getlist('tpks')
     if pks or tpks:
         user = request.user
-        filter = Q(pk__in=pks) | Q(thread__in=tpks)
-        mgs_to_change = Message.objects.as_recipient(user, filter)
+        filter_ = Q(pk__in=pks) | Q(thread__in=tpks)
+        mgs_to_change = Message.objects.as_recipient(user, filter_)
         if read:
             mgs_to_change.update(read_at=now())
         else:
             mgs_to_change.update(read_at=None)
         return redirect(request.GET.get('next', next_url))
     else:
-        messages.error(request, u("Couldn't mark messages as unread. Sorry."))
+        messages.error(request, (u"Couldn't mark messages as unread. Sorry."))
         return redirect(request.GET.get('next'))