<commit_before>from radar_api.serializers.cohort_users import CohortUserSerializer
from radar_api.serializers.meta import MetaSerializerMixin
from radar_api.serializers.organisation_users import OrganisationUserSerializer
from radar_api.serializers.patients import OrganisationReferenceField, CohortReferenceField
from radar.serializers.core import Serializer
from radar.serializers.fields import StringField, IntegerField, ListField
from radar.serializers.models import ModelSerializer
from radar.models import User


class UserSerializer(MetaSerializerMixin, ModelSerializer):
    organisations = ListField(field=OrganisationUserSerializer(), source='organisation_users', read_only=True)
    cohorts = ListField(field=CohortUserSerializer(), source='cohort_users', read_only=True)

    current_password = StringField(write_only=True)
    password = StringField(write_only=True)

    class Meta(object):
        model_class = User
        fields = ('id', 'is_admin', 'username', 'email', 'first_name', 'last_name')


class UserListRequestSerializer(Serializer):
    id = IntegerField()<commit_msg>Force password changes on the client<commit_after>from radar_api.serializers.cohort_users import CohortUserSerializer
from radar_api.serializers.meta import MetaSerializerMixin
from radar_api.serializers.organisation_users import OrganisationUserSerializer
from radar_api.serializers.patients import OrganisationReferenceField, CohortReferenceField
from radar.serializers.core import Serializer
from radar.serializers.fields import StringField, IntegerField, ListField
from radar.serializers.models import ModelSerializer
from radar.models import User


class UserSerializer(MetaSerializerMixin, ModelSerializer):
    organisations = ListField(field=OrganisationUserSerializer(), source='organisation_users', read_only=True)
    cohorts = ListField(field=CohortUserSerializer(), source='cohort_users', read_only=True)

    current_password = StringField(write_only=True)
    password = StringField(write_only=True)

    class Meta(object):
        model_class = User
        fields = (
            'id',
            'is_admin',
            'username',
            'email',
            'first_name',
            'last_name',
            'force_password_change'
        )


class UserListRequestSerializer(Serializer):
    id = IntegerField()
{'fraction_non_alphanumeric': 0.07570573139435414, 'fraction_numerical': 0.0, 'mean_word_length': 5.4082191780821915, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '909140', 'n_tokens_mistral': 613, 'n_tokens_neox': 590, 'n_words': 135}