Merge pull request #831 from AlanCoding/field_names

Use Options models to consolidate field_names list
This commit is contained in:
Ryan Petrello
2018-01-08 10:36:16 -05:00
committed by GitHub
5 changed files with 15 additions and 18 deletions

View File

@@ -307,9 +307,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)