1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-30 15:04:18 +00:00

fixed (?) db.py

blame steffo if something breaks
This commit is contained in:
Fabio De Simone 2019-01-28 22:32:47 +01:00 committed by Stefano Pigozzi
parent c1f0f34aa8
commit e903c6484f

4
db.py
View file

@ -16,7 +16,7 @@ import re
import enum import enum
# Both packages have different pip names # Both packages have different pip names
# noinspection PyPackageRequirements # noinspection PyPackageRequirements
from discord import User as DiscordUser # from discord import User as DiscordUser
# noinspection PyPackageRequirements # noinspection PyPackageRequirements
from telegram import User as TelegramUser from telegram import User as TelegramUser
import loldata import loldata
@ -689,7 +689,7 @@ class Discord(Base, Mini):
return f"<db.Discord {self.discord_id}>" return f"<db.Discord {self.discord_id}>"
@staticmethod @staticmethod
def create(session: Session, royal_username, discord_user: DiscordUser): def create(session: Session, royal_username, discord_user: "DiscordUser"):
d = session.query(Discord).filter(Discord.discord_id == discord_user.id).first() d = session.query(Discord).filter(Discord.discord_id == discord_user.id).first()
if d is not None: if d is not None:
raise AlreadyExistingError(repr(d)) raise AlreadyExistingError(repr(d))