From d50508661c6a2ee688836620e272a0e5eda1781c Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 4 Sep 2014 15:37:20 +0200 Subject: [PATCH] Minor improvements on project profile controller. --- app/coffee/modules/admin/project-profile.coffee | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/coffee/modules/admin/project-profile.coffee b/app/coffee/modules/admin/project-profile.coffee index 28be9169..45f38dfb 100644 --- a/app/coffee/modules/admin/project-profile.coffee +++ b/app/coffee/modules/admin/project-profile.coffee @@ -53,11 +53,14 @@ class ProjectProfileController extends mixOf(taiga.Controller, taiga.PageMixin) promise = @.loadInitialData() - promise.then () => + promise.then => @appTitle.set("Project profile - " + @scope.sectionName + " - " + @scope.project.name) - promise.then null, -> - console.log "FAIL" #TODO + promise.then null, (xhr) => + if xhr and xhr.status == 404 + @location.path("/not-found") + @location.replace() + return @q.reject(xhr) loadProject: -> return @rs.projects.get(@scope.projectId).then (project) => @@ -77,10 +80,6 @@ class ProjectProfileController extends mixOf(taiga.Controller, taiga.PageMixin) @scope.projectId = data.project return data - promise.then null, => - @location.path("/not-found") - @location.replace() - return promise.then(=> @.loadProject()) openDeleteLightbox: ->