mirror of
https://github.com/ansible/awx.git
synced 2026-03-21 02:47:35 -02:30
fix user form non submission error
This commit is contained in:
@@ -9,6 +9,7 @@ function UserEdit({ user, history }) {
|
|||||||
const [formSubmitError, setFormSubmitError] = useState(null);
|
const [formSubmitError, setFormSubmitError] = useState(null);
|
||||||
|
|
||||||
const handleSubmit = async values => {
|
const handleSubmit = async values => {
|
||||||
|
setFormSubmitError(null);
|
||||||
try {
|
try {
|
||||||
await UsersAPI.update(user.id, values);
|
await UsersAPI.update(user.id, values);
|
||||||
history.push(`/users/${user.id}/details`);
|
history.push(`/users/${user.id}/details`);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ function UserFormFields({ user, i18n }) {
|
|||||||
|
|
||||||
const organizationFieldArr = useField({
|
const organizationFieldArr = useField({
|
||||||
name: 'organization',
|
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 organizationMeta = organizationFieldArr[1];
|
||||||
const organizationHelpers = organizationFieldArr[2];
|
const organizationHelpers = organizationFieldArr[2];
|
||||||
|
|||||||
Reference in New Issue
Block a user