From 97b1c22414a0c6f83db8231b6fdd4673709d836c Mon Sep 17 00:00:00 2001 From: Valimp Date: Thu, 7 Dec 2023 09:32:25 +0100 Subject: [PATCH] fix config issues --- .env | 3 ++- app/api.py | 14 +++++++------- app/models.py | 1 - 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.env b/.env index 5bdc5aa..b3aa137 100644 --- a/.env +++ b/.env @@ -20,4 +20,5 @@ POSTGRES_HOST=postgres POSTGRES_DB=postgres POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres -POSTGRES_EXPOSE=127.0.0.1:5432 \ No newline at end of file +# expose postgres on localhost for dev +# POSTGRES_EXPOSE=127.0.0.1:5432 \ No newline at end of file diff --git a/app/api.py b/app/api.py index f1440a9..591bf94 100644 --- a/app/api.py +++ b/app/api.py @@ -1,5 +1,5 @@ from datetime import datetime -from enum import Enum +from enum import Enum, auto from pathlib import Path from fastapi import FastAPI, HTTPException, Request @@ -58,16 +58,16 @@ async def catch_exceptions(request: Request, call_next): class TicketStatus(str, Enum): - open = "open" - closed = "closed" + open = auto() + closed = auto() class TicketCreate(BaseModel): barcode: str = Field(..., description="Barcode of the product") type: str = Field(..., description="Type of the issue") - url: str = Field(..., description="URL of the product") + url: str = Field(..., description="URL of the product, only for search issues") status: TicketStatus = Field(..., description="Status of the ticket") - image_id: str = Field(..., description="Image ID of the product") + image_id: str = Field(..., description="ID of the flagged image") flavour: Flavor = Field(..., description="Flavour of the product") created_at: datetime = Field(default_factory=datetime.utcnow) @@ -79,7 +79,7 @@ class Ticket(TicketCreate): class FlagCreate(BaseModel): barcode: str = Field(..., description="Barcode of the product") type: str = Field(..., description="Type of the issue") - url: str = Field(..., description="URL of the product") + url: str = Field(..., description="URL of the product, only for search issues") user_id: str = Field(..., description="User ID of the flagger") device_id: str = Field(..., description="Device ID of the flagger") source: str = Field(..., description="Source of the flag") @@ -87,7 +87,7 @@ class FlagCreate(BaseModel): ..., description="Confidence of the flag, it's a machine learning confidence score. It's a float between 0 and 1 and it's optional.", ) - image_id: str = Field(..., description="Image ID of the product") + image_id: str = Field(..., description="Image ID of the flagged image") flavour: Flavor = Field(..., description="Flavour of the product") reason: str = Field(..., description="Reason of the flag") comment: str = Field(..., description="Comment of the flag") diff --git a/app/models.py b/app/models.py index 51414db..e55f917 100644 --- a/app/models.py +++ b/app/models.py @@ -13,7 +13,6 @@ ) -# Définissez vos modèles de table class TicketModel(Model): id = IntegerField(primary_key=True) barcode = CharField()