fix activation code
This commit is contained in:
parent
80d9a6a400
commit
17a4679b90
|
@ -61,7 +61,10 @@ def register():
|
|||
|
||||
|
||||
def send_activation_email(user):
|
||||
activation = ActivationCode.create(user_id=user.id, code=random_string(30))
|
||||
# the activation code is valid for 1h
|
||||
activation = ActivationCode.create(
|
||||
user_id=user.id, code=random_string(30), expired=arrow.now().shift(hours=1)
|
||||
)
|
||||
db.session.commit()
|
||||
|
||||
# Send user activation email
|
||||
|
|
|
@ -196,8 +196,7 @@ class ActivationCode(db.Model, ModelMixin):
|
|||
|
||||
user = db.relationship(User)
|
||||
|
||||
# the activation code is valid for 1h
|
||||
expired = db.Column(ArrowType, default=arrow.now().shift(hours=1))
|
||||
expired = db.Column(ArrowType)
|
||||
|
||||
|
||||
class ResetPasswordCode(db.Model, ModelMixin):
|
||||
|
|
Loading…
Reference in New Issue