feat(data): remove writing of old config

### Description of Changes
  Phase three of config data model change.
This commit is contained in:
Charlton Austin 2017-03-28 14:35:47 -04:00
parent ca99535774
commit 40906afdd8
4 changed files with 2 additions and 27 deletions

View file

@ -9,7 +9,6 @@ from data.database import (BuildTriggerService, RepositoryBuildTrigger, Reposito
RepositoryBuild, BUILD_PHASE, db_for_update, db_random_func)
from data.model import (InvalidBuildTriggerException, InvalidRepositoryBuildException,
db_transaction, user as user_model)
from data.model.helpers.build_helper import _get_config_expand
PRESUMED_DEAD_BUILD_AGE = timedelta(days=15)
PHASES_NOT_ALLOWED_TO_CANCEL_FROM = (BUILD_PHASE.PUSHING, BUILD_PHASE.COMPLETE,
@ -19,7 +18,7 @@ ARCHIVABLE_BUILD_PHASES = [BUILD_PHASE.COMPLETE, BUILD_PHASE.ERROR, BUILD_PHASE.
def update_build_trigger(trigger, config, auth_token=None, write_token=None):
trigger.config = json.dumps(_get_config_expand(config or {}))
trigger.config = json.dumps(config or {})
if auth_token is not None:
trigger.auth_token = auth_token
@ -30,13 +29,12 @@ def update_build_trigger(trigger, config, auth_token=None, write_token=None):
def create_build_trigger(repo, service_name, auth_token, user, pull_robot=None, config=None):
config = config or {}
service = BuildTriggerService.get(name=service_name)
trigger = RepositoryBuildTrigger.create(repository=repo, service=service,
auth_token=auth_token,
connected_user=user,
pull_robot=pull_robot,
config=json.dumps(_get_config_expand(config)))
config=json.dumps(config or {}))
return trigger