diff --git a/truthinquiry/ext/database/models.py b/truthinquiry/ext/database/models.py index c53d077..957a8be 100644 --- a/truthinquiry/ext/database/models.py +++ b/truthinquiry/ext/database/models.py @@ -1,6 +1,6 @@ import uuid -from sqlalchemy import Column, Integer, VARCHAR, Text, LargeBinary, ForeignKey, UUID +from sqlalchemy import Column, Integer, VARCHAR, Text, LargeBinary, ForeignKey from sqlalchemy.orm import relationship, declarative_base Base = declarative_base() @@ -200,7 +200,7 @@ class Reaction(Base): IMG = Column(LargeBinary(length=2**24), comment="Binary data of the image associated to this npc and trait") NPC = relationship("Npc") TRAIT = relationship("Trait") - REACTION_UUID = Column(UUID, unique=True, comment="ID of this reaction") + REACTION_UUID = Column(VARCHAR(255), unique=True, comment="ID of this reaction") def __init__(self, REACTION_ID, NPC_ID, TRAIT_ID): self.REACTION_ID = REACTION_ID diff --git a/truthinquiry/routes/routes_api.py b/truthinquiry/routes/routes_api.py index 055ce50..1a89169 100644 --- a/truthinquiry/routes/routes_api.py +++ b/truthinquiry/routes/routes_api.py @@ -161,7 +161,7 @@ def get_npc_reaction(): @routes_api.route("/getReaction", methods=["GET", "POST"]) def get_reaction(): input_uuid = flask.request.values.get("uuid") - results = db.session.execute(select(Reaction).where(Reaction.REACTION_UUID==uuid.UUID(input_uuid))) + results = db.session.execute(select(Reaction).where(Reaction.REACTION_UUID==input_uuid)) row = results.first() if row == None: