Skip to content

Commit

Permalink
Do not take into account prereleases
Browse files Browse the repository at this point in the history
  • Loading branch information
Insoleet committed Mar 7, 2016
1 parent 86e9a0f commit f947268
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/sakia/core/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,14 @@ async def get_last_version(self):
if not latest:
latest = r
else:
latest_date = datetime.datetime.strptime(latest['published_at'], "%Y-%m-%dT%H:%M:%SZ")
date = datetime.datetime.strptime(r['published_at'], "%Y-%m-%dT%H:%M:%SZ")
if latest_date < date:
latest = r
try:
latest_date = datetime.datetime.strptime(latest['published_at'], "%Y-%m-%dT%H:%M:%SZ")
date = datetime.datetime.strptime(r['published_at'], "%Y-%m-%dT%H:%M:%SZ")
parsed = parse_version(r["tag_name"])
if not parsed.is_prerelease and latest_date < date:
latest = r
except TypeError:
pass
latest_version = latest["tag_name"]
version = (__version__ == latest_version,
latest_version,
Expand Down

0 comments on commit f947268

Please sign in to comment.