From b36560bffb1d626acfb7d05114312267d8cd7b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Sun, 4 Dec 2016 20:04:00 +0100 Subject: [PATCH] Hot fix for cache update while user import (Fixes #2727). --- openslides/users/serializers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openslides/users/serializers.py b/openslides/users/serializers.py index d48d91ef8..ae4c4cd59 100644 --- a/openslides/users/serializers.py +++ b/openslides/users/serializers.py @@ -3,6 +3,7 @@ from django.contrib.auth.models import Permission from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_lazy +from ..utils.autoupdate import inform_changed_data from ..utils.rest_api import ( IdPrimaryKeyRelatedField, ModelSerializer, @@ -79,7 +80,10 @@ class UserFullSerializer(ModelSerializer): validated_data['default_password'] = User.objects.generate_password() validated_data['password'] = make_password(validated_data['default_password'], '', 'md5') # Perform creation in the database and return new user. - return super().create(validated_data) + user = super().create(validated_data) + # TODO: This autoupdate call is redundant (required by issue #2727). See #2736. + inform_changed_data(user) + return user class PermissionRelatedField(RelatedField):