Commits

murarth committed a84839c

Fixed Comment delete by an admin

  • Participants
  • Parent commits e4cf92a

Comments (0)

Files changed (1)

reddish/model/__init__.py

             r['unread_mail'] = self.unread_count()
             if self.moderated:
                 r['unread_mod_mail'] = self.mod_unread_count()
-        if user.admin:
+
+        if user.admin and self.banned:
             r['banned'] = self.get_banned_by().name
 
         return r
 
         try:
             Session.find_and_modify(Comment,
-                { '_id': self._id, 'author': user._id,
-                    'deleted': None },
+                { '_id': self._id, 'deleted': None },
                 { '$set': { 'deleted': user._id } })
         except exc.NotFound:
             raise ClientError('You cannot delete this comment')