Commit f25ca3ca authored by Deamos's avatar Deamos

debugging

parent 2d3f204a
......@@ -210,18 +210,18 @@ def init_db_values():
app.config.update(SECURITY_REGISTERABLE=sysSettings.allowRegistration)
## Begin DB UTF8MB4 Fixes To Convert The DB if Needed
#if config.dbLocation[:6] != "sqlite":
# dbEngine = db.engine
# dbConnection = dbEngine.connect()
# dbConnection.execute("ALTER DATABASE `%s` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci'" % dbEngine.url.database)
# sql = "SELECT DISTINCT(table_name) FROM information_schema.columns WHERE table_schema = '%s'" % dbEngine.url.database
# results = dbConnection.execute(sql)
# for row in results:
# sql = "ALTER TABLE `%s` convert to character set DEFAULT COLLATE DEFAULT" % (row[0])
# db.Connection.execute(sql)
# db.close()
if config.dbLocation[:6] != "sqlite":
dbEngine = db.engine
dbConnection = dbEngine.connect()
dbConnection.execute("ALTER DATABASE `%s` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci'" % dbEngine.url.database)
sql = "SELECT DISTINCT(table_name) FROM information_schema.columns WHERE table_schema = '%s'" % dbEngine.url.database
results = dbConnection.execute(sql)
for row in results:
sql = "ALTER TABLE `%s` convert to character set DEFAULT COLLATE DEFAULT" % (row[0])
db.Connection.execute(sql)
db.close()
## End DB UT8MB4 Fixes
def check_existing_users():
......@@ -1353,9 +1353,10 @@ def settings_channels_page():
newChannel = Channel.Channel(current_user.id, newUUID, channelName, topic, record, chatEnabled, allowComments, description)
if 'photo' in request.files:
filename = photos.save(request.files['photo'], name=str(uuid.uuid4()) + '.')
newChannel.imageLocation = filename
file = request.files['photo']
if file.filename != '':
filename = photos.save(request.files['photo'], name=str(uuid.uuid4()) + '.')
newChannel.imageLocation = filename
db.session.add(newChannel)
db.session.commit()
......@@ -1388,7 +1389,6 @@ def settings_channels_page():
if 'photo' in request.files:
file = request.files['photo']
if file.filename != '':
print(file.filename)
oldImage = None
if requestedChannel.imageLocation != None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment