Fixed guild_id showing only first number

This commit is contained in:
Jeremy Zhang 2017-05-08 19:13:53 +00:00
parent 531aa948b9
commit b475cc4e64
4 changed files with 21 additions and 10 deletions

View File

@ -24,9 +24,15 @@ def get_logingreeting():
def guild_embed(guild_id):
if check_guild_existance(guild_id):
guild = db.session.query(Guilds).filter(Guilds.guild_id == guild_id).first()
guild_dict = {
"id": guild.guild_id,
"name": guild.name,
"unauth_users": guild.unauth_users,
"icon": guild.icon
}
return render_template("embed.html.j2",
login_greeting=get_logingreeting(),
guild_id=guild_id, guild=guild,
guild_id=guild_id, guild=guild_dict,
generate_guild_icon=generate_guild_icon_url,
unauth_enabled=guild_query_unauth_users_bool(guild_id),
client_id=config['client-id']

View File

@ -88,8 +88,13 @@ def administrate_guild(guild_id):
all_members = db.session.query(UnauthenticatedUsers).filter(UnauthenticatedUsers.guild_id == guild_id).order_by(UnauthenticatedUsers.last_timestamp).all()
all_bans = db.session.query(UnauthenticatedBans).filter(UnauthenticatedBans.guild_id == guild_id).all()
users = prepare_guild_members_list(all_members, all_bans)
dbguild_dict = {"unauth_users": db_guild.unauth_users}
return render_template("administrate_guild.html.j2", guild=db_guild, dbguild=dbguild_dict, members=users, permissions=permissions)
dbguild_dict = {
"id": db_guild.guild_id,
"name": db_guild.name,
"unauth_users": db_guild.unauth_users,
"icon": db_guild.icon
}
return render_template("administrate_guild.html.j2", guild=dbguild_dict, members=users, permissions=permissions)
@user.route("/administrate_guild/<guild_id>", methods=["POST"])
@discord_users_only()

View File

@ -42,7 +42,7 @@
<div class="switch">
<label>
Disable
<input type="checkbox" id="unauth_users" name="unauth_users" {% if dbguild['unauth_users'] %}checked{% endif %} >
<input type="checkbox" id="unauth_users" name="unauth_users" {% if guild['unauth_users'] %}checked{% endif %} >
<span class="lever"></span>
Enable
</label>

View File

@ -10,7 +10,7 @@
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>{{ guild.name }} - Embed - Titan Embeds for Discord</title>
<title>{{ guild['name'] }} - Embed - Titan Embeds for Discord</title>
{% include 'google_analytics.html.j2' %}
</head>
<body>
@ -32,16 +32,16 @@
<ul id="guild-nav" class="side-nav">
<li>
<div class="userView">
{% if guild.icon %}
<img class="circle" src="{{ generate_guild_icon( guild.id, guild.icon ) }}">
{% if guild['icon'] %}
<img class="circle" src="{{ generate_guild_icon( guild['id'], guild['icon'] ) }}">
{% endif %}
<span class="name">{{ guild.name }}</span>
<span class="name">{{ guild['name'] }}</span>
</div>
</li>
<li><a class="subheader">Actions</a></li>
<li><a href="{{ url_for("user.administrate_guild", guild_id=guild.id) }}" class="waves-effect" target="_blank" id="administrate_link" style="display: none;">Manage Guild Embed</a></li>
<li><a href="https://discordapp.com/channels/{{ guild.id }}/" class="waves-effect" target="_blank">Open Server on Discordapp</a></li>
<li><a href="{{ url_for("user.administrate_guild", guild_id=guild['id']) }}" class="waves-effect" target="_blank" id="administrate_link" style="display: none;">Manage Guild Embed</a></li>
<li><a href="https://discordapp.com/channels/{{ guild['id'] }}/" class="waves-effect" target="_blank">Open Server on Discordapp</a></li>
<li><div class="divider"></div></li>