From 7ff8bcdefe76ab33121c4cd4d82195b093dae894 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sun, 8 Jul 2018 20:38:59 +0000 Subject: [PATCH] JSON dump the roles before putting in db --- webapp/titanembeds/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/titanembeds/utils.py b/webapp/titanembeds/utils.py index 7a75654..e0bf1df 100644 --- a/webapp/titanembeds/utils.py +++ b/webapp/titanembeds/utils.py @@ -200,7 +200,7 @@ def get_member_roles(guild_id, user_id): member = discord_api.get_guild_member(guild_id, user_id) if member["success"]: roles = list(map(int, member["content"]["roles"])) - member = GuildMembers(guild_id, user_id, member["content"]["user"]["username"], int(member["content"]["user"]["discriminator"]), member["content"].get("nick", None), member["content"]["user"]["avatar"], True, False, roles) + member = GuildMembers(guild_id, user_id, member["content"]["user"]["username"], int(member["content"]["user"]["discriminator"]), member["content"].get("nick", None), member["content"]["user"]["avatar"], True, False, json.dumps(roles)) db.session.add(member) db.session.commit() else: