mirror of
https://github.com/aljazceru/CTFd.git
synced 2026-02-02 04:44:25 +01:00
Changes the default charset for MySQL (#282)
This bug is actually quite sneaky and was breaking exports
This commit is contained in:
@@ -43,7 +43,11 @@ def create_app(config='CTFd.config.Config'):
|
||||
|
||||
# Creates database if the database database does not exist
|
||||
if not database_exists(url):
|
||||
create_database(url)
|
||||
if url.drivername.startswith('mysql'):
|
||||
url.query['charset'] = 'utf8mb4'
|
||||
create_database(url, encoding='utf8mb4')
|
||||
else:
|
||||
create_database(url)
|
||||
|
||||
# Register database
|
||||
db.init_app(app)
|
||||
|
||||
Reference in New Issue
Block a user