mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 05:54:19 +01:00
Update requirements (#406)
* Updating to use dataset and datafreeze
* Use a new datafreeze serializer to get around Python 3 issues.
* Update requirements.txt
* Add simple test for export_ctf()
This commit is contained in:
@@ -4,6 +4,7 @@ from sqlalchemy_utils import database_exists, create_database, drop_database
|
||||
from sqlalchemy.engine.url import make_url
|
||||
import datetime
|
||||
import six
|
||||
import gc
|
||||
|
||||
if six.PY2:
|
||||
text_type = unicode
|
||||
@@ -42,6 +43,7 @@ def destroy_ctfd(app):
|
||||
with app.app_context():
|
||||
app.db.session.commit()
|
||||
app.db.session.close_all()
|
||||
gc.collect() # Garbage collect (necessary in the case of dataset freezes to clean database connections)
|
||||
app.db.drop_all()
|
||||
drop_database(app.config['SQLALCHEMY_DATABASE_URI'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user