Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#6324 closed (fixed)

[patch] 'UserFlagManager' object has no attribute 'objects'

Reported by: deafwolf Owned by: nobody
Component: contrib.comments Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


When I call UserFlag.objects.flag(comment, request.user), it throw a exception:
'UserFlagManager' object has no attribute 'objects'

--- django/contrib/comments/	(revision 6996)
+++ django/contrib/comments/	(working copy)
@@ -257,7 +257,7 @@
         if int(comment.user_id) == int(
             return # A user can't flag his own comment. Fail silently.
-            f = self.objects.get(,
+           f = self.get(,
         except self.model.DoesNotExist:
             from django.core.mail import mail_managers
             f = self.model(None,,, None)

Attachments (1)

django_comments_patch.diff (653 bytes) - added by Sam Bull <sbull@…> 11 years ago.
the patch to comments.models

Download all attachments as: .zip

Change History (4)

Changed 11 years ago by Sam Bull <sbull@…>

Attachment: django_comments_patch.diff added

the patch to comments.models

comment:1 Changed 11 years ago by Sam Bull <sbull@…>

It looks like this flag method used to live in UserFlag instead of in UserFlagManager, and this line is a hold-over from it's former life. As far as I can tell, UserFlag.objects.flag will never work because of this.

comment:2 Changed 11 years ago by Gary Wilson

Resolution: fixed
Status: newclosed

(In [7039]) Fixed #6324 -- Fixed get() call in UserFlagManager.flag().

comment:3 Changed 11 years ago by anonymous


Note: See TracTickets for help on using tickets.
Back to Top