diff --git a/beat/web/accounts/serializers.py b/beat/web/accounts/serializers.py index 5d3cd2820b0c732a7ad40aeb775129c4d9b6858f..59679a3754d2e917cc8aeee30d320da82e7d26b4 100644 --- a/beat/web/accounts/serializers.py +++ b/beat/web/accounts/serializers.py @@ -25,20 +25,13 @@ # # ############################################################################### -from django.contrib.auth.models import User, AnonymousUser - +from django.contrib.auth.models import User from rest_framework import serializers -from .models import Profile, SupervisionTrack -from ..common.models import Contribution -from ..common.fields import JSONSerializerField -from ..ui.templatetags.markup import restructuredtext -from ..common.utils import validate_restructuredtext - -import simplejson as json +from .models import SupervisionTrack -#---------------------------------------------------------- +# ---------------------------------------------------------- class UserSerializer(serializers.ModelSerializer): @@ -47,7 +40,7 @@ class UserSerializer(serializers.ModelSerializer): class Meta: model = User - fields = ['username', 'email'] + fields = ["username", "email"] def get_username(self, obj): return obj.username @@ -56,7 +49,7 @@ class UserSerializer(serializers.ModelSerializer): return obj.email -#---------------------------------------------------------- +# ---------------------------------------------------------- class BasicSupervisionTrackSerializer(serializers.ModelSerializer): @@ -70,12 +63,12 @@ class BasicSupervisionTrackSerializer(serializers.ModelSerializer): class Meta: model = SupervisionTrack - fields = ['is_valid'] + fields = ["is_valid"] - #def get_supervisee(self, obj): + # def get_supervisee(self, obj): # return obj.supervisee - #def get_supervisor(self, obj): + # def get_supervisor(self, obj): # return obj.supervisor def get_is_valid(self, obj): @@ -94,20 +87,27 @@ class BasicSupervisionTrackSerializer(serializers.ModelSerializer): return obj.supervision_key -#---------------------------------------------------------- +# ---------------------------------------------------------- class FullSupervisionTrackSerializer(BasicSupervisionTrackSerializer): - class Meta(BasicSupervisionTrackSerializer.Meta): - fields = ['supervisee', 'supervisor', 'is_valid', 'start_date', 'expiration_date','last_validation_date', 'supervision_key'] + fields = [ + "supervisee", + "supervisor", + "is_valid", + "start_date", + "expiration_date", + "last_validation_date", + "supervision_key", + ] -#---------------------------------------------------------- +# ---------------------------------------------------------- class SupervisionTrackUpdateSerializer(BasicSupervisionTrackSerializer): pass -#---------------------------------------------------------- +# ----------------------------------------------------------