A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
json parse version string
Michael Shamoond02c7df75cfb
diff --git a/src/documents/views.py b/src/documents/views.pyindex 09f18c9e6..858a3bab6 100644--- a/src/documents/views.py+++ b/src/documents/views.py@@ -1,6 +1,6 @@+import jsonimport loggingimport os-import reimport tempfileimport urllibimport uuid@@ -683,9 +683,11 @@ class RemoteVersionView(GenericAPIView):+ "/paperless-ngx/main/src/paperless/version.py",) as response:remote = response.read().decode("utf-8")- match = re.search(r"(\d+, \d+, \d+)", remote)- if match:- remote_version = ".".join(match[0].split(", "))+ try:+ remote_json = json.loads(remote)+ remote_version = remote_json["tag_name"].replace("ngx-", "")+ except ValueError:+ logger.debug("An error occured parsing remote version json")except urllib.error.URLError:logger.debug("An error occured checking for available updates")