mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 07:26:03 -03:30
Merge pull request #4704 from keithjgrant/4522-save-nt-after-fixing-form-errors
Fix Notification Template form validation of headers field Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -105,7 +105,7 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
|
|||||||
|
|
||||||
$scope.$watch('headers', function validate_headers(str) {
|
$scope.$watch('headers', function validate_headers(str) {
|
||||||
try {
|
try {
|
||||||
let headers = JSON.parse(str);
|
const headers = typeof str === 'string' ? JSON.parse(str) : str;
|
||||||
if (_.isObject(headers) && !_.isArray(headers)) {
|
if (_.isObject(headers) && !_.isArray(headers)) {
|
||||||
let valid = true;
|
let valid = true;
|
||||||
for (let k in headers) {
|
for (let k in headers) {
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ export default ['Rest', 'Wait',
|
|||||||
|
|
||||||
$scope.$watch('headers', function validate_headers(str) {
|
$scope.$watch('headers', function validate_headers(str) {
|
||||||
try {
|
try {
|
||||||
let headers = JSON.parse(str);
|
const headers = typeof str === 'string' ? JSON.parse(str) : str;
|
||||||
if (_.isObject(headers) && !_.isArray(headers)) {
|
if (_.isObject(headers) && !_.isArray(headers)) {
|
||||||
let valid = true;
|
let valid = true;
|
||||||
for (let k in headers) {
|
for (let k in headers) {
|
||||||
|
|||||||
Reference in New Issue
Block a user