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:
parent
5e391a04bc
commit
f468183631
4 changed files with 252 additions and 82 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue