Skip to content

Commit

Permalink
Allow navigation when validation error triggers in project_questions
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Aug 9, 2024
1 parent 5e29ffa commit a2ebccc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -884,14 +884,14 @@ angular.module('project_questions')
if (response.status == 500) {
service.error = response;
} else if (response.status == 400) {
service.error = true;
service.error = response;
if (angular.isDefined(response.data.text)) {
value.errors = response.data.text
} else {
value.errors = Object.keys(response.data);
}
} else if (response.status == 404) {
service.error = true;
service.error = response;
value.errors = ['not_found']
}
})
Expand Down Expand Up @@ -944,8 +944,8 @@ angular.module('project_questions')
service.error = null; // reset error before saving
if (service.settings.project_questions_autosave) {
service.save(false, true).then(function() {
if (service.error !== null) {
// pass, dont jump
if (service.error !== null && service.error.status !== 400) {
// pass, dont jump (but not on a validation error)
} else if (angular.isDefined(page)) {
service.initView(page.id);
} else if (angular.isDefined(section)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load i18n %}
{% load core_tags %}

<div class="text-danger" ng-show="service.error.statusText && service.error.status">
<div class="text-danger" ng-show="service.error.statusText && service.error.status != 400">
<p>
{% trans 'An error occurred while saving the answer. Please contact support if this problem persists.' %}
</p>
Expand Down

0 comments on commit a2ebccc

Please sign in to comment.