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)
| 489 | methods=['GET']) |
| 490 | @pgCSRFProtect.exempt |
| 491 | def 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) |
nothing calls this directly
no test coverage detected