remove job_type scan from options

* Need to keep the scan job in job_type for migrations so just remove it
from the constructed OPTIONS
This commit is contained in:
Chris Meyers
2017-07-19 14:16:31 -04:00
parent f31cec2848
commit c11b870084
2 changed files with 21 additions and 1 deletions

View File

@@ -236,3 +236,19 @@ class RoleMetadata(Metadata):
"disassociate": {"type": "integer", "label": "Disassociate", "help_text": "Provide to remove this role."},
}
return metadata
# TODO: Tower 3.3 remove class and all uses in views.py when API v1 is removed
class JobTypeMetadata(Metadata):
def get_field_info(self, field):
res = super(JobTypeMetadata, self).get_field_info(field)
if field.field_name == 'job_type':
index = 0
for choice in res['choices']:
if choice[0] == 'scan':
res['choices'].pop(index)
break
index += 1
return res