Commit 868a06ea authored by Valentin Samir's avatar Valentin Samir

Really pick the last version on Pypi for new version checking.

We were only sorting version string lexicographically and it would have break when
we reach version 0.10.N or 0.N.10
parent 990f00fe
Pipeline #583 passed with stage
in 12 minutes and 31 seconds
...@@ -13,6 +13,12 @@ Added ...@@ -13,6 +13,12 @@ Added
----- -----
* Add autofocus to the username input on the login page * Add autofocus to the username input on the login page
Fixed
-----
* Really pick the last version on Pypi for new version checking.
We were only sorting version string lexicographically and it would have break when
we reach version 0.10.N or 0.N.10
v0.7.2 - 2016-08-31 v0.7.2 - 2016-08-31
=================== ===================
......
...@@ -653,7 +653,8 @@ def check_password(method, password, hashed_password, charset): ...@@ -653,7 +653,8 @@ def check_password(method, password, hashed_password, charset):
def decode_version(version): def decode_version(version):
""" """
decode a version string following version semantic http://semver.org/ input a tuple of int decode a version string following version semantic http://semver.org/ input a tuple of int.
It will work as long as we do not use pre release versions.
:param unicode version: A dotted version :param unicode version: A dotted version
:return: A tuple a int :return: A tuple a int
...@@ -683,9 +684,7 @@ def last_version(): ...@@ -683,9 +684,7 @@ def last_version():
try: try:
req = requests.get(settings.CAS_NEW_VERSION_JSON_URL) req = requests.get(settings.CAS_NEW_VERSION_JSON_URL)
data = json.loads(req.text) data = json.loads(req.text)
versions = list(data["releases"].keys()) version = data["info"]["version"]
versions.sort()
version = versions[-1]
last_version._cache = (time.time(), version, True) last_version._cache = (time.time(), version, True)
return version return version
except ( except (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment