Skip to content

Commit

Permalink
Merge pull request #31 from arXiv/develop
Browse files Browse the repository at this point in the history
fix for expiry bug
  • Loading branch information
erickpeirson authored Jan 30, 2019
2 parents 5aa1f74 + 6d3ecf7 commit f14ed58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion users/arxiv/users/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ def expires(self) -> Optional[int]:
"""
if self.end_time is None:
return None
return max((self.end_time - datetime.now(tz=UTC)).seconds, 0)
duration = (self.end_time - datetime.now(tz=UTC)).total_seconds()
return max(duration, 0)


# Helpers and private functions.
Expand Down
2 changes: 1 addition & 1 deletion users/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name='arxiv-auth',
version='0.2.4',
version='0.2.5',
packages=[f'arxiv.{package}' for package
in find_packages('./arxiv', exclude=['*test*'])],
install_requires=[
Expand Down

0 comments on commit f14ed58

Please sign in to comment.