Return normal titan logo if guest icon does not exist and av fixes

This commit is contained in:
Jeremy Zhang 2017-09-24 04:51:31 +00:00
parent 86a2a5fe66
commit d6c43e853b
3 changed files with 4 additions and 4 deletions

View File

@ -180,7 +180,7 @@ def update_administrate_guild(guild_id):
guest_icon = None guest_icon = None
db_guild.guest_icon = guest_icon db_guild.guest_icon = guest_icon
db.session.commit() 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( return jsonify(
id=db_guild.id, id=db_guild.id,
guild_id=db_guild.guild_id, guild_id=db_guild.guild_id,

View File

@ -359,8 +359,8 @@ def change_unauthenticated_username():
return response return response
def get_guild_guest_icon(guild_id): 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): def process_query_guild(guild_id, visitor=False):
widget = discord_api.get_widget(guild_id) widget = discord_api.get_widget(guild_id)

View File

@ -243,7 +243,7 @@ def update_administrate_guild(guild_id):
db_guild.guest_icon = guest_icon db_guild.guest_icon = guest_icon
db.session.commit() 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( return jsonify(
id=db_guild.id, id=db_guild.id,
guild_id=db_guild.guild_id, guild_id=db_guild.guild_id,