Browse Source

Borro las reservas antiguas

politica
Celestino Rey 1 year ago
parent
commit
df493a62b0
2 changed files with 26 additions and 0 deletions
  1. +19
    -0
      Mail/config.py
  2. +7
    -0
      Padel/servicios/padel/reservas.py

+ 19
- 0
Mail/config.py View File

@ -0,0 +1,19 @@
from flask import Flask
from flask_mail import Mail, Message
app = Flask(__name__)
app.config['MAIL_SERVER']= 'smtp.gmail.com'
#app.config['MAIL_USERNAME'] = 'devesapark@yahoo.com'
#app.config['MAIL_PASSWORD'] = 'xUp7bax8knAVwi'
app.config['MAIL_USERNAME'] = 'devesaparkpadel@gmail.com'
app.config['MAIL_PASSWORD'] = 'xUp7bax8knAVwi'
app.config['MAIL_USE_TLS'] = False # si se pone a True, hay que descomentar la línea siguiente
#app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_SSL'] = True # si se pone a True, hay que descomentar la línea siguiente
app.config['MAIL_PORT'] = 465
mail = Mail(app)

+ 7
- 0
Padel/servicios/padel/reservas.py View File

@ -34,8 +34,15 @@ mail = Mail(app)
@bp.route("/misreservas")
@login_required
def misreservas():
hoy = date.today()
db = get_db()
db.execute(
"DELETE FROM reservas WHERE fecha<? AND nombre=?", (hoy,current_user.name,)
)
db.commit()
reservas = db.execute(
"SELECT id, nombre, fecha, hora FROM reservas WHERE nombre=? ORDER BY fecha DESC", (current_user.name,)
).fetchall()


Loading…
Cancel
Save