Skip to content

Conversation

@prateekj117
Copy link
Member

Fixes #5943

Checklist

  • I have read the Contribution & Best practices Guide and my PR follows them.
  • My branch is up-to-date with the Upstream development branch.
  • The unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • All the functions created/modified in this PR contain relevant docstrings.

Short description of what this resolves:

Pytz function used to save same timestamp in Database in case of subsequent requests.

Changes proposed in this pull request:

Use Inbuild SqlAlchemy Function for saving Timestamp

@auto-label auto-label bot added the fix label May 22, 2019
@codecov
Copy link

codecov bot commented May 22, 2019

Codecov Report

Merging #5948 into development will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #5948      +/-   ##
===============================================
+ Coverage        66.43%   66.44%   +<.01%     
===============================================
  Files              285      285              
  Lines            13869    13871       +2     
===============================================
+ Hits              9214     9216       +2     
  Misses            4655     4655
Impacted Files Coverage Δ
app/models/user.py 56.27% <100%> (+0.17%) ⬆️
app/models/session.py 90.1% <100%> (+0.1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e49d771...b59e85c. Read the comment docs.


import pytz
from sqlalchemy import event, func
from sqlalchemy.sql import func as dateandtime
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
from sqlalchemy.sql import func as dateandtime
from sqlalchemy.sql import func as sql_func

@iamareebjamal
Copy link
Member

It isn't anywhere else?

@prateekj117
Copy link
Member Author

@iamareebjamal Yes.

@iamareebjamal iamareebjamal changed the title fix: Use SqlAlchemy Inbuild timestamp function fix: Use SQLAlchemy Inbuild timestamp function May 22, 2019
@iamareebjamal iamareebjamal changed the title fix: Use SQLAlchemy Inbuild timestamp function fix: Use SQLAlchemy in-built timestamp function May 22, 2019
@iamareebjamal iamareebjamal merged commit 2c1da2f into fossasia:development May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timestamp saved in Database is not correct

2 participants