Package: python-django-guardian
Version: 1.1.1-2
Severity: important
Tags: patch upstream

Hello maintainer,

As described in <https://github.com/lukaszb/django-guardian/issues/164>,
setting AUTH_USER_MODEL to an abstract user model results in a broken
get_objects_for_user method.

A patch sourced from upstream is attached.

-- 
Luke Faraone;; Debian & Ubuntu Developer; Sugar Labs, Systems
lfaraone on irc.[freenode,oftc].net -- http://luke.faraone.cc
PGP fprint: 5189 2A7D 16D0 49BB 046B DC77 9732 5DD8 F9FD D506
From c2a97befa491e498bf27912a6cf1343ca40aa896 Mon Sep 17 00:00:00 2001
From: thepapermen <the.paper....@gmail.com>
Date: Tue, 24 Sep 2013 10:17:20 +0400
Subject: [PATCH] Fixed Django 1.6 incompatibility issue.

---
 guardian/shortcuts.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guardian/shortcuts.py b/guardian/shortcuts.py
index 9ca2bdf..2219348 100644
--- a/guardian/shortcuts.py
+++ b/guardian/shortcuts.py
@@ -395,7 +395,7 @@ def get_objects_for_user(user, perms, klass=None, use_groups=True, any_perm=Fals
         group_filters = {
             'permission__content_type': ctype,
             'permission__codename__in': codenames,
-            'group__%s' % get_user_model()._meta.module_name: user,
+            'group__%s' % get_user_model().groups.field.related_query_name(): user,
         }
         groups_obj_perms_queryset = group_model.objects.filter(**group_filters)
         if group_model.objects.is_generic():
-- 
1.8.5.1

Attachment: signature.asc
Description: Digital signature

Reply via email to