Skip to content

Commit 148fd7d

Browse files
committed
tmp: logging
1 parent a50cbab commit 148fd7d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

selfservice/models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
Boolean,
1212
func,
1313
)
14+
from sqlalchemy.sql.functions import now
1415
from selfservice import db
1516

1617

@@ -23,7 +24,7 @@ class ResetToken(db.Model):
2324
__tablename__ = "token"
2425
id = Column(Integer, primary_key=True)
2526
username = Column(String(64), nullable=False)
26-
created = Column(DateTime, default=func.timezone("UTC", func.now()))
27+
created = Column(DateTime, default=func.timezone("UTC", now()))
2728
token = Column(String(36))
2829
session = Column(String(36), ForeignKey("session.id"))
2930
used = Column(Boolean)
@@ -39,7 +40,7 @@ class RecoverySession(db.Model):
3940
__tablename__ = "session"
4041
id = Column(String(36), primary_key=True)
4142
username = Column(String(64), nullable=False)
42-
created = Column(DateTime, default=func.timezone("UTC", func.now()))
43+
created = Column(DateTime, default=func.timezone("UTC", now()))
4344

4445

4546
class PhoneVerification(db.Model):

selfservice/utilities/general.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
import smtplib
6+
import logging
67

78
from datetime import datetime, timedelta
89
from email.mime.text import MIMEText
@@ -66,6 +67,10 @@ def phone_recovery(phone, token):
6667
current_app.config.get("TWILIO_SID"), current_app.config.get("TWILIO_TOKEN")
6768
)
6869

70+
# REMOVE ME
71+
client.http_client.logger.setLevel(logging.INFO)
72+
# REMOVE ME
73+
6974
body = f"Your CSH account recovery PIN is: {token}"
7075

7176
client.messages.create(

0 commit comments

Comments
 (0)