From e0b73ff68a0b8338349672a0ed7a288be5894ef1 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Sun, 17 Apr 2016 22:42:56 +0200 Subject: [PATCH] Use group_id instead of group in User form views --- openslides/users/static/js/users/site.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openslides/users/static/js/users/site.js b/openslides/users/static/js/users/site.js index c7411de17..539ced2ba 100644 --- a/openslides/users/static/js/users/site.js +++ b/openslides/users/static/js/users/site.js @@ -479,7 +479,7 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users']) $scope.addGroupMultiple = function (group) { angular.forEach($scope.users, function (user) { if (user.selected) { - user.groups.push(group); + user.groups_id.push(group); User.save(user); } }); @@ -490,9 +490,9 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users']) $scope.removeGroupMultiple = function (group) { angular.forEach($scope.users, function (user) { if (user.selected) { - var groupIndex = user.groups.indexOf(parseInt(group)); + var groupIndex = user.groups_id.indexOf(parseInt(group)); if (groupIndex > -1) { - user.groups.splice(groupIndex, 1); + user.groups_id.splice(groupIndex, 1); User.save(user); } } @@ -535,8 +535,8 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users']) // save user $scope.save = function (user) { - if (!user.groups) { - user.groups = []; + if (!user.groups_id) { + user.groups_id = []; } User.create(user).then( function(success) { @@ -574,8 +574,8 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users']) // save user $scope.save = function (user) { - if (!user.groups) { - user.groups = []; + if (!user.groups_id) { + user.groups_id = []; } // inject the changed user (copy) object back into DS store User.inject(user);