Sanitize/Validate name field (#20)

* escape name
* add email pydantic validation (API)
* format prettier
* don't allow slash on email also
* make regex const
* use string literals
* make get ticket a POST
* email regex


Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
Tiago Vasconcelos 2024-01-26 14:30:14 +00:00 committed by GitHub
parent 5e391a04bc
commit f468183631
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 252 additions and 82 deletions

View file

@ -1,5 +1,5 @@
from fastapi import Query
from pydantic import BaseModel
from pydantic import BaseModel, EmailStr
from typing import Optional
@ -17,7 +17,7 @@ class CreateEvent(BaseModel):
class CreateTicket(BaseModel):
name: str
email: str
email: EmailStr
class Event(BaseModel):