refresh user before create project

stable
Juanfran 2016-04-20 12:21:39 +02:00
parent df07c8cf51
commit 5026ecbf33
2 changed files with 6 additions and 6 deletions

View File

@ -79,7 +79,7 @@ class LightboxService extends taiga.Service
if $el.hasClass("remove-on-close")
scope = $el.data("scope")
scope.$destroy()
scope.$destroy() if scope
$el.remove()
closeAll: ->

View File

@ -35,10 +35,6 @@ CreateProject = ($rootscope, $repo, $confirm, $location, $navurls, $rs, $project
$scope.templates = []
currentLoading = null
$auth.refresh()
$scope.canCreatePrivateProjects = currentUserService.canCreatePrivateProjects()
$scope.canCreatePublicProjects = currentUserService.canCreatePublicProjects()
form = $el.find("form").checksley({"onlyOneErrorElement": true})
onSuccessSubmit = (response) ->
@ -88,6 +84,9 @@ CreateProject = ($rootscope, $repo, $confirm, $location, $navurls, $rs, $project
else
$scope.data.creation_template = _.head(_.filter($scope.templates, (x) -> x.slug == "scrum")).id
$scope.canCreatePrivateProjects = currentUserService.canCreatePrivateProjects()
$scope.canCreatePublicProjects = currentUserService.canCreatePublicProjects()
lightboxService.open($el)
submitButton = $el.find(".submit-button")
@ -101,7 +100,8 @@ CreateProject = ($rootscope, $repo, $confirm, $location, $navurls, $rs, $project
$scope.$on "$destroy", ->
$el.off()
openLightbox()
$auth.refresh().then () ->
openLightbox()
directive = {
link: link,