mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-19 12:01:12 +02:00
Update views.py
This commit is contained in:
@@ -44,17 +44,16 @@ def create():
|
|||||||
tit = data["tit"]
|
tit = data["tit"]
|
||||||
wal = data["wal"]
|
wal = data["wal"]
|
||||||
cldate = data["cldate"]
|
cldate = data["cldate"]
|
||||||
nooftickets = data["nooftickets"]
|
notickets = data["notickets"]
|
||||||
prtick = data["prtick"]
|
prtick = data["prtickets"]
|
||||||
usr = data["usr"]
|
usr = data["usr"]
|
||||||
wall = wal.split("-")
|
wall = wal.split("-")
|
||||||
|
|
||||||
# Form validation
|
# Form validation
|
||||||
if (
|
if (
|
||||||
int(amt) < 0
|
not tit.replace(" ", "").isalnum()
|
||||||
or not tit.replace(" ", "").isalnum()
|
|
||||||
or wal == ""
|
or wal == ""
|
||||||
or int(nooftickets) < 0
|
or int(notickets) < 0
|
||||||
or int(prtick) < 0
|
or int(prtick) < 0
|
||||||
):
|
):
|
||||||
return jsonify({"ERROR": "FORM ERROR"}), 401
|
return jsonify({"ERROR": "FORM ERROR"}), 401
|
||||||
@@ -82,8 +81,8 @@ def create():
|
|||||||
events_ext_db.execute(
|
events_ext_db.execute(
|
||||||
"""
|
"""
|
||||||
INSERT OR IGNORE INTO events
|
INSERT OR IGNORE INTO events
|
||||||
(usr, wal, walnme, walinvkey, uni, tit, cldate, nooftickets, prtick)
|
(usr, wal, walnme, walinvkey, uni, tit, cldate, notickets, prtick)
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||||
""",
|
""",
|
||||||
(
|
(
|
||||||
usr,
|
usr,
|
||||||
@@ -93,7 +92,7 @@ def create():
|
|||||||
uni,
|
uni,
|
||||||
tit,
|
tit,
|
||||||
cldate,
|
cldate,
|
||||||
nooftickets,
|
notickets,
|
||||||
prtick,
|
prtick,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user