1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

[bug taiga#20] group change not propagated

This commit is contained in:
Sylvain 2016-04-12 10:10:16 +02:00
parent 4845c1cc91
commit d1a9a69d14
2 changed files with 3 additions and 1 deletions

View File

@ -80,6 +80,7 @@ Application.Controllers.controller "EditProfileController", ["$scope", "$rootSco
Member.update {id: $scope.user.id}, {user: {group_id: $scope.userGroup}}, (user) ->
$scope.user = user
$rootScope.currentUser = user
Auth._currentUser.group_id = user.group_id
$scope.group.change = false
growl.success(_t('your_group_has_been_successfully_changed'))
, (err) ->

View File

@ -95,6 +95,7 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop
$scope.group.change = false
if $scope.currentUser.role isnt 'admin'
$rootScope.currentUser = user
Auth._currentUser.group_id = user.group_id
growl.success(_t('your_group_was_successfully_changed'))
else
growl.success(_t('the_user_s_group_was_successfully_changed'))
@ -112,7 +113,7 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop
# @return {string} 'male' or 'female'
##
$scope.getGender = (user) ->
if user.profile
if user and user.profile
if user.profile.gender == "true" then 'male' else 'female'
else 'other'