From ff088a6a2452ae6e47cd5964e85bde5c510a6d3c Mon Sep 17 00:00:00 2001 From: fram3d Date: Tue, 3 Oct 2023 22:52:40 +0200 Subject: [PATCH] bug fixing --- freeriders/routes.py | 7 ++++--- freeriders/templates/index.html | 14 -------------- freeriders/templates/sms.html | 29 +---------------------------- freeriders/templates/submit.html | 18 ++++++++++++++++++ 4 files changed, 23 insertions(+), 45 deletions(-) delete mode 100644 freeriders/templates/index.html create mode 100644 freeriders/templates/submit.html diff --git a/freeriders/routes.py b/freeriders/routes.py index e21eca6..85b0038 100644 --- a/freeriders/routes.py +++ b/freeriders/routes.py @@ -1,6 +1,6 @@ from flask import render_template, request, redirect from freeriders import app, db -from freeriders.models import Ticket +from freeriders.models import Tickets from datetime import datetime import time @@ -8,7 +8,8 @@ import time def sms(): if request.method == 'GET': try: - lastticket = Ticket.query.order_by(Ticket.timestamp.desc()).first() + lastticket = Tickets.query.order_by(Tickets.timestamp.desc()).first().ticket + lastticket = "{:010d}".format(lastticket) date = datetime.now() datenow = f'{"{:02d}".format(date.day)}.{"{:02d}".format(date.month)}.{date.year}' timenow = f'{"{:02d}".format(date.hour)}:{"{:02d}".format(date.minute)}:{date.second}' @@ -27,7 +28,7 @@ def submit(): ticket_input = request.form['ticket'] if ticket_input.isdigit() and len(ticket_input) == 10: - ticket = Ticket(ticket = int(ticket_input), timestamp = timenow) + ticket = Tickets(ticket = int(ticket_input), timestamp = timenow) else: return 'Ticket format is wrong. Only 10 digits allowed.' diff --git a/freeriders/templates/index.html b/freeriders/templates/index.html deleted file mode 100644 index 8d81d5b..0000000 --- a/freeriders/templates/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - Ticket tracking - - -
-
- - diff --git a/freeriders/templates/sms.html b/freeriders/templates/sms.html index ae07217..dac2d9b 100644 --- a/freeriders/templates/sms.html +++ b/freeriders/templates/sms.html @@ -4,7 +4,7 @@ Karta - +
@@ -26,33 +26,6 @@ za ovu kartu prema JKP Naplata prevozne usluge Beograd. Sacuvajte ovu poruku. -
- A90 -
-
- U Beogradu, za broj telefona ste kupili - VREMENSKU KARTU OD 90 MINUTA U ZONI A po - ceni od 50 din + osnovna cena poruke, - koja vazi do 03.10.2023, 09:42:54. - Karta broj: 0000343232. - Placanjem operateru izmirujete dugovanja - za ovu kartu prema JKP Naplata prevozne - usluge Beograd. Sacuvajte ovu poruku. -
-
08:23
-
- A90 -
-
- U Beogradu, za broj telefona ste kupili - VREMENSKU KARTU OD 90 MINUTA U ZONI A po - ceni od 50 din + osnovna cena poruke, - koja vazi do 03.10.2023, 09:42:54. - Karta broj: 0000343232. - Placanjem operateru izmirujete dugovanja - za ovu kartu prema JKP Naplata prevozne - usluge Beograd. Sacuvajte ovu poruku. -