mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-15 07:48:38 -05:00
Do not allow state where no Galaxy servers are enabled
This commit is contained in:
@@ -903,6 +903,11 @@ def galaxy_validate(serializer, attrs):
|
||||
setting_name = '{}{}'.format(prefix, k.upper())
|
||||
errors.setdefault(setting_name, [])
|
||||
errors[setting_name].append(msg)
|
||||
if not galaxy_data['url']:
|
||||
if _new_value('PUBLIC_GALAXY_ENABLED') is False:
|
||||
errors.setdefault('PUBLIC_GALAXY_ENABLED', [])
|
||||
msg = _('A URL for Primary Galaxy must be defined before disabling public Galaxy.')
|
||||
errors['PUBLIC_GALAXY_ENABLED'].append(msg)
|
||||
|
||||
if errors:
|
||||
raise serializers.ValidationError(errors)
|
||||
|
||||
Reference in New Issue
Block a user