mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
A few super minor nits in api views/serializers (#12996)
Signed-off-by: Rick Elrod <rick@elrod.me>
This commit is contained in:
parent
534763727f
commit
208254ab81
@ -615,7 +615,7 @@ class BaseSerializer(serializers.ModelSerializer, metaclass=BaseSerializerMetacl
|
||||
def validate(self, attrs):
|
||||
attrs = super(BaseSerializer, self).validate(attrs)
|
||||
try:
|
||||
# Create/update a model instance and run it's full_clean() method to
|
||||
# Create/update a model instance and run its full_clean() method to
|
||||
# do any validation implemented on the model class.
|
||||
exclusions = self.get_validation_exclusions(self.instance)
|
||||
obj = self.instance or self.Meta.model()
|
||||
@ -3229,7 +3229,7 @@ class JobCreateScheduleSerializer(LabelsListMixin, BaseSerializer):
|
||||
ret['labels'] = self._summary_field_labels(config)
|
||||
return ret
|
||||
except JobLaunchConfig.DoesNotExist:
|
||||
return {'all': _('Unknown, job may have been ran before launch configurations were saved.')}
|
||||
return {'all': _('Unknown, job may have been run before launch configurations were saved.')}
|
||||
|
||||
|
||||
class AdHocCommandSerializer(UnifiedJobSerializer):
|
||||
|
||||
@ -2406,9 +2406,8 @@ class JobTemplateLaunch(RetrieveAPIView):
|
||||
"""
|
||||
modern_data = data.copy()
|
||||
|
||||
id_fd = '{}_id'.format('inventory')
|
||||
if 'inventory' not in modern_data and id_fd in modern_data:
|
||||
modern_data['inventory'] = modern_data[id_fd]
|
||||
if 'inventory' not in modern_data and 'inventory_id' in modern_data:
|
||||
modern_data['inventory'] = modern_data['inventory_id']
|
||||
|
||||
# credential passwords were historically provided as top-level attributes
|
||||
if 'credential_passwords' not in modern_data:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user