Commit fb9365ab authored by Deamos's avatar Deamos

Fix for if there is no photo

parent 3a5ad556
......@@ -1392,8 +1392,11 @@ def settings_channels_page():
if requestedChannel.imageLocation != None:
oldImage = requestedChannel.imageLocation
filename = photos.save(request.files['photo'], name=str(uuid.uuid4()) + '.')
requestedChannel.imageLocation = filename
try:
filename = photos.save(request.files['photo'], name=str(uuid.uuid4()) + '.')
requestedChannel.imageLocation = filename
except:
pass
if oldImage != None:
try:
......@@ -1408,9 +1411,11 @@ def settings_channels_page():
if requestedChannel.offlineImageLocation != None:
oldImage = requestedChannel.offlineImageLocation
filename = photos.save(request.files['offlinephoto'], name=str(uuid.uuid4()) + '.')
requestedChannel.offlineImageLocation = filename
try:
filename = photos.save(request.files['offlinephoto'], name=str(uuid.uuid4()) + '.')
requestedChannel.offlineImageLocation = filename
except:
pass
if oldImage != None:
try:
os.remove(oldImage)
......
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