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 | 1 | # -*- coding: utf-8 -*- |
| 2 | 2 | |
| 3 | +from django.contrib.auth import get_user_model | |
| 4 | + | |
| 3 | 5 | from tastypie import fields |
| 4 | 6 | from tastypie.constants import ALL_WITH_RELATIONS, ALL |
| 5 | 7 | from tastypie.resources import ModelResource |
| 6 | 8 | |
| 7 | -from accounts.models import User | |
| 8 | 9 | from super_archives.models import Message, EmailAddress |
| 9 | 10 | from proxy.models import Revision, Ticket, Wiki |
| 10 | 11 | |
| 11 | 12 | |
| 13 | +User = get_user_model() | |
| 14 | + | |
| 15 | + | |
| 12 | 16 | class UserResource(ModelResource): |
| 13 | 17 | class Meta: |
| 14 | 18 | queryset = User.objects.filter(is_active=True) | ... | ... |