From 7a3002d05e6ec456ef800533784ca465a1f20aea Mon Sep 17 00:00:00 2001 From: Omkar Khatavkar Date: Fri, 14 Sep 2018 20:03:53 +0530 Subject: [PATCH] added custom cron field for 6.5 feature in sync plan (#535) --- nailgun/entities.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nailgun/entities.py b/nailgun/entities.py index d4ddd1db..04237ca1 100644 --- a/nailgun/entities.py +++ b/nailgun/entities.py @@ -25,8 +25,7 @@ from sys import version_info import hashlib import os.path - -from fauxfactory import gen_alphanumeric +from fauxfactory import gen_alphanumeric, gen_choice from packaging.version import Version from nailgun import client, entity_fields, signals @@ -6397,7 +6396,8 @@ def __init__(self, server_config=None, **kwargs): 'description': entity_fields.StringField(), 'enabled': entity_fields.BooleanField(required=True), 'interval': entity_fields.StringField( - choices=('hourly', 'daily', 'weekly'), + choices=('hourly', 'daily', 'weekly', 'custom cron'), + default=gen_choice(('hourly', 'daily', 'weekly')), required=True, ), 'name': entity_fields.StringField( @@ -6406,6 +6406,9 @@ def __init__(self, server_config=None, **kwargs): length=(6, 12), unique=True ), + 'cron_expression': entity_fields.StringField( + str_type='alpha' + ), 'organization': entity_fields.OneToOneField( Organization, required=True,