Commit 352083410d8779cd71487b99604e46c96a451808
1 parent
da6226fd
Exists in
master
and in
39 other branches
Importing user model properly
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
src/api/resources.py
1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
2 | 2 | ||
3 | +from django.contrib.auth import get_user_model | ||
4 | + | ||
3 | from tastypie import fields | 5 | from tastypie import fields |
4 | from tastypie.constants import ALL_WITH_RELATIONS, ALL | 6 | from tastypie.constants import ALL_WITH_RELATIONS, ALL |
5 | from tastypie.resources import ModelResource | 7 | from tastypie.resources import ModelResource |
6 | 8 | ||
7 | -from accounts.models import User | ||
8 | from super_archives.models import Message, EmailAddress | 9 | from super_archives.models import Message, EmailAddress |
9 | from proxy.models import Revision, Ticket, Wiki | 10 | from proxy.models import Revision, Ticket, Wiki |
10 | 11 | ||
11 | 12 | ||
13 | +User = get_user_model() | ||
14 | + | ||
15 | + | ||
12 | class UserResource(ModelResource): | 16 | class UserResource(ModelResource): |
13 | class Meta: | 17 | class Meta: |
14 | queryset = User.objects.filter(is_active=True) | 18 | queryset = User.objects.filter(is_active=True) |