use Options models to consolidate field_names list

This commit is contained in:
AlanCoding
2017-12-13 18:11:37 -05:00
parent 2fb0144914
commit e188692acf
5 changed files with 15 additions and 18 deletions

View File

@@ -306,9 +306,9 @@ class Project(UnifiedJobTemplate, ProjectOptions, ResourceMixin):
@classmethod
def _get_unified_job_field_names(cls):
return ['name', 'description', 'local_path', 'scm_type', 'scm_url',
'scm_branch', 'scm_clean', 'scm_delete_on_update',
'credential', 'schedule', 'timeout',]
return set(f.name for f in ProjectOptions._meta.fields) | set(
['name', 'description', 'schedule']
)
def save(self, *args, **kwargs):
new_instance = not bool(self.pk)