diff --git a/webapp/titanembeds/blueprints/admin/admin.py b/webapp/titanembeds/blueprints/admin/admin.py index 71f544d..326c403 100644 --- a/webapp/titanembeds/blueprints/admin/admin.py +++ b/webapp/titanembeds/blueprints/admin/admin.py @@ -180,7 +180,7 @@ def update_administrate_guild(guild_id): guest_icon = None db_guild.guest_icon = guest_icon db.session.commit() - emit("guest_icon_change", {"guest_icon": guest_icon}, room="GUILD_"+guild_id, namespace="/gateway") + emit("guest_icon_change", {"guest_icon": guest_icon if guest_icon else url_for('static', filename='img/titanembeds_square.png')}, room="GUILD_"+guild_id, namespace="/gateway") return jsonify( id=db_guild.id, guild_id=db_guild.guild_id, diff --git a/webapp/titanembeds/blueprints/api/api.py b/webapp/titanembeds/blueprints/api/api.py index e2655b4..089088e 100644 --- a/webapp/titanembeds/blueprints/api/api.py +++ b/webapp/titanembeds/blueprints/api/api.py @@ -359,8 +359,8 @@ def change_unauthenticated_username(): return response def get_guild_guest_icon(guild_id): - return db.session.query(Guilds).filter(Guilds.guild_id == guild_id).first().guest_icon - + guest_icon = db.session.query(Guilds).filter(Guilds.guild_id == guild_id).first().guest_icon + return guest_icon if guest_icon else url_for('static', filename='img/titanembeds_square.png') def process_query_guild(guild_id, visitor=False): widget = discord_api.get_widget(guild_id) diff --git a/webapp/titanembeds/blueprints/user/user.py b/webapp/titanembeds/blueprints/user/user.py index 9738823..2fcd15b 100644 --- a/webapp/titanembeds/blueprints/user/user.py +++ b/webapp/titanembeds/blueprints/user/user.py @@ -243,7 +243,7 @@ def update_administrate_guild(guild_id): db_guild.guest_icon = guest_icon db.session.commit() - emit("guest_icon_change", {"guest_icon": guest_icon}, room="GUILD_"+guild_id, namespace="/gateway") + emit("guest_icon_change", {"guest_icon": guest_icon if guest_icon else url_for('static', filename='img/titanembeds_square.png')}, room="GUILD_"+guild_id, namespace="/gateway") return jsonify( id=db_guild.id, guild_id=db_guild.guild_id,