Opened 8 years ago

Closed 8 years ago

Last modified 7 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: UI/UX:


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@…> 8 years ago.
the patch to comments.models

Download all attachments as: .zip

Change History (4)

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

the patch to comments.models

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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 8 years ago by gwilson

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:3 Changed 7 years ago by anonymous


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