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 ...@@ -4,29 +4,25 @@ from django.contrib import admin
from eav.admin import BaseEntityAdmin, BaseSchemaAdmin from eav.admin import BaseEntityAdmin, BaseSchemaAdmin
# from sorl.thumbnail.admin import AdminImageMixin # 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): class AnObjAdmin(BaseEntityAdmin):
form = AnObjForm pass
# form = AnObjForm
admin.site.register(AnObj, AnObjAdmin) admin.site.register(AnObj, AnObjAdmin)
admin.site.register(AOType) # admin.site.register(AOType)
class AOSchemaAdmin(BaseSchemaAdmin):
filter_horizontal = ('ao_types', )
admin.site.register(AOSchema, AOSchemaAdmin)
class AOChoiceAdmin(admin.ModelAdmin): # class AOSchemaAdmin(BaseSchemaAdmin):
list_filter = ('schema', ) # filter_horizontal = ('ao_types', )
# admin.site.register(AOSchema, AOSchemaAdmin)
admin.site.register(AOChoice, AOChoiceAdmin) # class AOChoiceAdmin(admin.ModelAdmin):
admin.site.register(AOAttribute) # list_filter = ('schema', )
# admin.site.register(AOChoice, AOChoiceAdmin)
# admin.site.register(AOAttribute)
admin.site.register(Annotation) admin.site.register(Annotation)
\ No newline at end of file
...@@ -5,7 +5,7 @@ import user ...@@ -5,7 +5,7 @@ import user
import uuid, random import uuid, random
from django.db import models from django.db import models
from django.conf import settings 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.utils.translation import ugettext as _
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.utils import timezone from django.utils import timezone
......
# coding=utf-8 # coding=utf-8
from __future__ import unicode_literals from __future__ import unicode_literals
import json import json
from django.contrib.auth import get_user_model
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
from django.http.response import HttpResponseForbidden, Http404 from django.http.response import HttpResponseForbidden, Http404
from django.conf import settings 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 django.shortcuts import get_object_or_404
from adim.models import AnObj, AnObjMembership, Annotation from adim.models import AnObj, AnObjMembership, Annotation
...@@ -182,7 +183,7 @@ class UserViewSet(viewsets.ReadOnlyModelViewSet): ...@@ -182,7 +183,7 @@ class UserViewSet(viewsets.ReadOnlyModelViewSet):
The anobj uuid is given as a querystring variable The anobj uuid is given as a querystring variable
?uuid=<the-uuid-value-for-the-anobj> ?uuid=<the-uuid-value-for-the-anobj>
""" """
model = get_model(*settings.AUTH_USER_MODEL.split('.')) model = get_user_model()
serializer_class = UserSerializer serializer_class = UserSerializer
def get_queryset(self): 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