mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-01 12:21:48 -05:00
Cleaned up some more stale TODO's and FIXME's (or did / fixed the things)
This commit is contained in:
@@ -218,8 +218,8 @@ class BaseSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
fields = ('id', 'type', 'url', 'related', 'summary_fields', 'created',
|
||||
'modified', 'name', 'description')
|
||||
summary_fields = () # FIXME: List of field names from this serializer that should be used when included as part of another's summary_fields.
|
||||
summarizable_fields = () # FIXME: List of field names on this serializer that should be included in summary_fields.
|
||||
summary_fields = ()
|
||||
summarizable_fields = ()
|
||||
|
||||
# add the URL and related resources
|
||||
type = serializers.SerializerMethodField()
|
||||
@@ -668,11 +668,6 @@ class UnifiedJobStdoutSerializer(UnifiedJobSerializer):
|
||||
else:
|
||||
return super(UnifiedJobStdoutSerializer, self).get_types()
|
||||
|
||||
# TODO: Needed?
|
||||
#def to_representation(self, obj):
|
||||
# ret = super(UnifiedJobStdoutSerializer, self).to_representation(obj)
|
||||
# return ret.get('result_stdout', '')
|
||||
|
||||
|
||||
class UserSerializer(BaseSerializer):
|
||||
|
||||
@@ -1309,7 +1304,6 @@ class InventorySourceOptionsSerializer(BaseSerializer):
|
||||
|
||||
def validate_source_vars(self, value):
|
||||
# source_env must be blank, a valid JSON or YAML dict, or ...
|
||||
# FIXME: support key=value pairs.
|
||||
try:
|
||||
json.loads((value or '').strip() or '{}')
|
||||
return value
|
||||
@@ -1335,9 +1329,9 @@ class InventorySourceOptionsSerializer(BaseSerializer):
|
||||
try:
|
||||
if source_script.organization != self.instance.inventory.organization:
|
||||
errors['source_script'] = "The 'source_script' does not belong to the same organization as the inventory."
|
||||
except Exception:
|
||||
# TODO: Log
|
||||
except Exception as exc:
|
||||
errors['source_script'] = "'source_script' doesn't exist."
|
||||
logger.error(str(exc))
|
||||
|
||||
if errors:
|
||||
raise serializers.ValidationError(errors)
|
||||
@@ -1610,8 +1604,6 @@ class ResourceAccessListElementSerializer(UserSerializer):
|
||||
|
||||
class CredentialSerializer(BaseSerializer):
|
||||
|
||||
# FIXME: may want to make some fields filtered based on user accessing
|
||||
|
||||
class Meta:
|
||||
model = Credential
|
||||
fields = ('*', 'kind', 'cloud', 'host', 'username',
|
||||
@@ -1886,7 +1878,6 @@ class JobTemplateSerializer(UnifiedJobTemplateSerializer, JobOptionsSerializer):
|
||||
|
||||
def validate_extra_vars(self, value):
|
||||
# extra_vars must be blank, a valid JSON or YAML dict, or ...
|
||||
# FIXME: support key=value pairs.
|
||||
try:
|
||||
json.loads((value or '').strip() or '{}')
|
||||
return value
|
||||
@@ -2574,7 +2565,6 @@ class ScheduleSerializer(BaseSerializer):
|
||||
try:
|
||||
rrule.rrulestr(rrule_value)
|
||||
except Exception:
|
||||
# TODO: Log
|
||||
raise serializers.ValidationError("rrule parsing failed validation.")
|
||||
return value
|
||||
|
||||
@@ -2609,7 +2599,6 @@ class ActivityStreamSerializer(BaseSerializer):
|
||||
try:
|
||||
return json.loads(obj.changes)
|
||||
except Exception:
|
||||
# TODO: Log
|
||||
logger.warn("Error deserializing activity stream json changes")
|
||||
return {}
|
||||
|
||||
|
||||
@@ -2301,7 +2301,6 @@ class JobTemplateSurveySpec(GenericAPIView):
|
||||
try:
|
||||
obj.survey_spec = json.dumps(request.data)
|
||||
except ValueError:
|
||||
# TODO: Log
|
||||
return Response(dict(error="Invalid JSON when parsing survey spec."), status=status.HTTP_400_BAD_REQUEST)
|
||||
if "name" not in obj.survey_spec:
|
||||
return Response(dict(error="'name' missing from survey spec."), status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
Reference in New Issue
Block a user