Gitlab CSE Unil

Commit c3ac5f4f authored by Julien Furrer's avatar Julien Furrer
Browse files

Small fix for 1.8 compatibility

parent 25c336e7
......@@ -4,29 +4,25 @@ from django.contrib import admin
from eav.admin import BaseEntityAdmin, BaseSchemaAdmin
# from sorl.thumbnail.admin import AdminImageMixin
from adim.models import AnObj, AOSchema, AOType, AOAttribute, AOChoice, Annotation
from adim.models import AnObj, Annotation # AOSchema, AOType, AOAttribute, AOChoice
from adim.forms import AnObjForm
# from adim.forms import AnObjForm
class AnObjAdmin(BaseEntityAdmin):
form = AnObjForm
pass
# form = AnObjForm
admin.site.register(AnObj, AnObjAdmin)
admin.site.register(AOType)
class AOSchemaAdmin(BaseSchemaAdmin):
filter_horizontal = ('ao_types', )
admin.site.register(AOSchema, AOSchemaAdmin)
# admin.site.register(AOType)
class AOChoiceAdmin(admin.ModelAdmin):
list_filter = ('schema', )
# class AOSchemaAdmin(BaseSchemaAdmin):
# filter_horizontal = ('ao_types', )
# admin.site.register(AOSchema, AOSchemaAdmin)
admin.site.register(AOChoice, AOChoiceAdmin)
admin.site.register(AOAttribute)
# class AOChoiceAdmin(admin.ModelAdmin):
# list_filter = ('schema', )
# admin.site.register(AOChoice, AOChoiceAdmin)
# admin.site.register(AOAttribute)
admin.site.register(Annotation)
\ No newline at end of file
......@@ -5,7 +5,7 @@ import user
import uuid, random
from django.db import models
from django.conf import settings
from django.contrib.contenttypes import generic
# from django.contrib.contenttypes import generic
from django.utils.translation import ugettext as _
from django.contrib.auth.models import User
from django.utils import timezone
......
# coding=utf-8
from __future__ import unicode_literals
import json
from django.contrib.auth import get_user_model
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.http.response import HttpResponseForbidden, Http404
from django.conf import settings
from django.db.models import get_model, Q
from django.db.models import Q
from django.shortcuts import get_object_or_404
from adim.models import AnObj, AnObjMembership, Annotation
......@@ -182,7 +183,7 @@ class UserViewSet(viewsets.ReadOnlyModelViewSet):
The anobj uuid is given as a querystring variable
?uuid=<the-uuid-value-for-the-anobj>
"""
model = get_model(*settings.AUTH_USER_MODEL.split('.'))
model = get_user_model()
serializer_class = UserSerializer
def get_queryset(self):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment