Skip to content
Snippets Groups Projects
Verified Commit 63b4e749 authored by hanfi's avatar hanfi
Browse files

input sanitation

parent 12f492ab
No related branches found
No related tags found
No related merge requests found
from datetime import datetime from datetime import datetime
from html import escape
from secrets import token_hex from secrets import token_hex
from cryptography.exceptions import InvalidSignature from cryptography.exceptions import InvalidSignature
...@@ -57,10 +58,10 @@ def update_item(db: Session, item: schemas.Item, data: schemas.ItemUpdate): ...@@ -57,10 +58,10 @@ def update_item(db: Session, item: schemas.Item, data: schemas.ItemUpdate):
verify = "" verify = ""
if data.addressee: if data.addressee:
verify += data.addressee verify += data.addressee
item.addressee = data.addressee item.addressee = escape(data.addressee)
if data.team: if data.team:
verify += data.team verify += data.team
item.team = data.team item.team = escape(data.team)
if data.amount: if data.amount:
verify += str(data.amount) verify += str(data.amount)
item.amount = data.amount item.amount = data.amount
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment