Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: email verification date type changed from datetime to float (#447) #460

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/api/dao/user.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from datetime import datetime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need to import datetime if you're no longer using it?

from operator import itemgetter
import time
from flask_restplus import marshal

from app import messages
Expand Down Expand Up @@ -326,7 +327,7 @@ def confirm_registration(token):
return messages.ACCOUNT_ALREADY_CONFIRMED, 200
else:
user.is_email_verified = True
user.email_verification_date = datetime.now()
user.email_verification_date = time.time()
user.save_to_db()
return messages.ACCOUNT_ALREADY_CONFIRMED_AND_THANKS, 200

Expand Down
2 changes: 1 addition & 1 deletion app/api/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def add_models_to_namespace(api_namespace):
required=True,
description='User email verification status'
),
'email_verification_date': fields.DateTime(
'email_verification_date': fields.Float(
required=False,
description='User email verification date'
),
Expand Down
2 changes: 1 addition & 1 deletion app/database/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class UserModel(db.Model):

# email verification
is_email_verified = db.Column(db.Boolean)
email_verification_date = db.Column(db.DateTime)
email_verification_date = db.Column(db.Float)

# other info
current_mentorship_role = db.Column(db.Integer)
Expand Down
2 changes: 1 addition & 1 deletion docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@
},
"email_verification_date": {
"type": "string",
"format": "date-time",
"format": "float",
"description": "User email verification date"
},
"bio": {
Expand Down