Skip to content

Commit

Permalink
Error check and leave check
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanBluth committed Mar 22, 2016
1 parent 0ef3423 commit 6446106
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion scenarioEditor/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,13 @@ def update_scenario_service(request, scenario_id):
scenario.order = scen_json['order']
scenario.type = scen_json['type']
file_name = scenario.jsonUrl
gitlab_utility.update_file(gitlab_utility.get_project_name(), PDUser.branch_for_user(user=request.user),
gitlab_result = gitlab_utility.update_file(gitlab_utility.get_project_name(), PDUser.branch_for_user(user=request.user),
file_name, scenario.script, "text")
if gitlab_result is False:
return HttpResponse("Gitlab save failed", status = 500)

scenario.save()

return HttpResponse(request.body)
else:
return HttpResponse("Unauthorized", status=401)
Expand Down
8 changes: 7 additions & 1 deletion static/js/scenarioEditor/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var application = angular.module('scenarioEditor', [
deleted = true;
}
if ($scope.onComplete != null) {
$scope.onComplete(deleted);
$scope.onComplete(deeleted);
}
}
}
Expand Down Expand Up @@ -556,3 +556,9 @@ scenarioEditor.controller('EditorCtrl', ['$scope', '$http', 'convoService', 'cha
init();
}
]);

$(document).ready(function(){
window.onbeforeunload = function (e) {
return 'Are you sure?';
};
});

0 comments on commit 6446106

Please sign in to comment.