Skip to content

Commit

Permalink
remove the ability to add constructed inventory sources
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Muniz authored and CFSNM committed Feb 14, 2023
1 parent 3f8edb9 commit 8e24252
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions awx/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2270,6 +2270,8 @@ def get_field_from_model_or_attrs(fd):
if get_field_from_model_or_attrs('source') == 'scm':
if ('source' in attrs or 'source_project' in attrs) and get_field_from_model_or_attrs('source_project') is None:
raise serializers.ValidationError({"source_project": _("Project required for scm type sources.")})
elif get_field_from_model_or_attrs('source') == 'constructed':
raise serializers.ValidationError({"Error": _('constructed not a valid source for inventory')})
else:
redundant_scm_fields = list(filter(lambda x: attrs.get(x, None), ['source_project', 'source_path']))
if redundant_scm_fields:
Expand Down

0 comments on commit 8e24252

Please sign in to comment.