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:
parent
4845c1cc91
commit
d1a9a69d14
@ -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) ->
|
||||
|
@ -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'
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user