Fix the trigger delete code and enable peewee autorollback.
This commit is contained in:
parent
0d4c66312b
commit
f8a1535e78
2 changed files with 4 additions and 2 deletions
|
@ -47,7 +47,8 @@ class RealTransactions(object):
|
||||||
class SQLiteDB(RealTransactions):
|
class SQLiteDB(RealTransactions):
|
||||||
DB_NAME = 'test/data/test.db'
|
DB_NAME = 'test/data/test.db'
|
||||||
DB_CONNECTION_ARGS = {
|
DB_CONNECTION_ARGS = {
|
||||||
'threadlocals': True
|
'threadlocals': True,
|
||||||
|
'autorollback': True,
|
||||||
}
|
}
|
||||||
DB_DRIVER = SqliteDatabase
|
DB_DRIVER = SqliteDatabase
|
||||||
|
|
||||||
|
@ -79,6 +80,7 @@ class RDSMySQL(RealTransactions):
|
||||||
'user': 'fluxmonkey',
|
'user': 'fluxmonkey',
|
||||||
'passwd': '8eifM#uoZ85xqC^',
|
'passwd': '8eifM#uoZ85xqC^',
|
||||||
'threadlocals': True,
|
'threadlocals': True,
|
||||||
|
'autorollback': True,
|
||||||
}
|
}
|
||||||
DB_DRIVER = MySQLDatabase
|
DB_DRIVER = MySQLDatabase
|
||||||
|
|
||||||
|
|
|
@ -1580,7 +1580,7 @@ def delete_build_trigger(namespace, repository, trigger_uuid):
|
||||||
'service': trigger.service.name, 'config': config_dict},
|
'service': trigger.service.name, 'config': config_dict},
|
||||||
repo=model.get_repository(namespace, repository))
|
repo=model.get_repository(namespace, repository))
|
||||||
|
|
||||||
trigger.delete_instance()
|
trigger.delete_instance(recursive=True)
|
||||||
return make_response('No Content', 204)
|
return make_response('No Content', 204)
|
||||||
|
|
||||||
abort(403) # Permission denied
|
abort(403) # Permission denied
|
||||||
|
|
Reference in a new issue