MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / auto_update

Function auto_update

web/pgadmin/misc/__init__.py:491–508  ·  view source on GitHub ↗

Get auto-update information for the desktop app. Returns update metadata (download URL and version name) if a newer version is available. Responds with HTTP 204 if the current version is up to date.

(current_version_int, latest_version, latest_version_int,
                product_name, ftp_url)

Source from the content-addressed store, hash-verified

489 methods=['GET'])
490@pgCSRFProtect.exempt
491def auto_update(current_version_int, latest_version, latest_version_int,
492 product_name, ftp_url):
493 """
494 Get auto-update information for the desktop app.
495
496 Returns update metadata (download URL and version name)
497 if a newer version is available. Responds with HTTP 204
498 if the current version is up to date.
499 """
500 if latest_version_int > current_version_int:
501 update_info = {
502 'url': unquote(ftp_url),
503 'name': f'{product_name} v{latest_version}',
504 }
505 current_app.logger.debug(update_info)
506 return make_response(response=update_info, status=200)
507 else:
508 return make_response(status=204)

Callers

nothing calls this directly

Calls 1

make_responseFunction · 0.90

Tested by

no test coverage detected