From bc0511fe66149eab21a0e01f5fc8a4aea14edc59 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Thu, 20 Feb 2020 14:32:03 -0500 Subject: [PATCH] fix user form non submission error --- awx/ui_next/src/screens/User/UserEdit/UserEdit.jsx | 1 + awx/ui_next/src/screens/User/shared/UserForm.jsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/ui_next/src/screens/User/UserEdit/UserEdit.jsx b/awx/ui_next/src/screens/User/UserEdit/UserEdit.jsx index 5cd6f0452b..04b043aa26 100644 --- a/awx/ui_next/src/screens/User/UserEdit/UserEdit.jsx +++ b/awx/ui_next/src/screens/User/UserEdit/UserEdit.jsx @@ -9,6 +9,7 @@ function UserEdit({ user, history }) { const [formSubmitError, setFormSubmitError] = useState(null); const handleSubmit = async values => { + setFormSubmitError(null); try { await UsersAPI.update(user.id, values); history.push(`/users/${user.id}/details`); diff --git a/awx/ui_next/src/screens/User/shared/UserForm.jsx b/awx/ui_next/src/screens/User/shared/UserForm.jsx index d51fc0cf9b..ad65385f42 100644 --- a/awx/ui_next/src/screens/User/shared/UserForm.jsx +++ b/awx/ui_next/src/screens/User/shared/UserForm.jsx @@ -40,7 +40,7 @@ function UserFormFields({ user, i18n }) { const organizationFieldArr = useField({ name: 'organization', - validate: required(i18n._(t`Select a value for this field`), i18n), + validate: !user.id ? required(i18n._(t`Select a value for this field`), i18n) : () => undefined }); const organizationMeta = organizationFieldArr[1]; const organizationHelpers = organizationFieldArr[2];