chore(backend): Wrap frappe.throw with _ (translate)#6154
chore(backend): Wrap frappe.throw with _ (translate)#6154
frappe.throw with _ (translate)#6154Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to internationalize backend exception messages by wrapping frappe.throw(...) strings with Frappe’s translation function (_ / frappe._) across the Press codebase.
Changes:
- Added
from frappe import _in many modules and wrappedfrappe.throw(...)messages for translation. - Converted several f-string error messages to
_("...").format(...)for translatable placeholders. - Includes a few incidental formatting/type-hint cleanups alongside the i18n updates.
Reviewed changes
Copilot reviewed 136 out of 136 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| press/www/dashboard.py | i18n: translate frappe.throw message |
| press/workflow_engine/doctype/press_workflow_test/press_workflow_test.py | i18n: translate validation error |
| press/workflow_engine/doctype/press_workflow/press_workflow.py | i18n: translate run() validation error |
| press/utils/webhook.py | i18n: translate invalid payload type |
| press/utils/extra.py | i18n: translate disabled method error |
| press/utils/billing.py | i18n: translate settings/connection errors |
| press/utils/init.py | i18n: translate various auth/validation errors |
| press/saas/doctype/saas_app_subscription/saas_app_subscription.py | i18n: translate plan mismatch error |
| press/saas/doctype/saas_app_plan/saas_app_plan.py | i18n + minor typing/format tweaks |
| press/saas/doctype/product_trial_request/product_trial_request.py | i18n: translate setup payload/domain errors |
| press/saas/doctype/product_trial/product_trial.py | i18n: translate permission/validation errors |
| press/saas/api/billing.py | i18n: translate invoice errors |
| press/saas/api/init.py | i18n: translate SaaS auth errors |
| press/press/report/press_endpoints_audit/press_endpoints_audit.py | i18n: translate directory access error |
| press/press/doctype/wireguard_peer/wireguard_peer.py | i18n: translate network error |
| press/press/doctype/virtual_machine_image/virtual_machine_image.py | i18n: translate validation error |
| press/press/doctype/virtual_machine/virtual_machine.py | i18n: translate many VM validation/provision errors |
| press/press/doctype/virtual_disk_snapshot/virtual_disk_snapshot.py | i18n: translate provider support errors |
| press/press/doctype/version_upgrade/version_upgrade.py | i18n: translate maintenance error |
| press/press/doctype/user_ssh_certificate/user_ssh_certificate.py | i18n: translate SSH cert validation errors |
| press/press/doctype/tls_certificate/tls_certificate.py | i18n: translate TLS validation/retry errors |
| press/press/doctype/team_deletion_request/team_deletion_request.py | i18n: translate permission/duplicate/outstanding invoice errors |
| press/press/doctype/team_change/team_change.py | i18n: translate owner mismatch error |
| press/press/doctype/team/team.py | i18n: translate access/validation errors |
| press/press/doctype/support_access/support_access.py | i18n: translate status/expiry/validation errors |
| press/press/doctype/subscription/subscription.py | i18n: translate duplicate subscription error |
| press/press/doctype/stripe_webhook_log/stripe_webhook_log.py | i18n: translate webhook signature/payload errors |
| press/press/doctype/ssh_certificate/ssh_certificate.py | i18n + minor formatting |
| press/press/doctype/site_user/site_user.py | i18n: translate disabled user error |
| press/press/doctype/site_update/site_update.py | i18n: translate site update validation errors |
| press/press/doctype/site_replication/site_replication.py | i18n + minor typing/format; one throw left untranslated |
| press/press/doctype/site_plan_change/site_plan_change.py | i18n: translate plan change validation errors |
| press/press/doctype/site_migration/site_migration.py | i18n: translate migration validation errors |
| press/press/doctype/site_group_deploy/site_group_deploy.py | i18n: translate duplicate subdomain/release group errors |
| press/press/doctype/site_domain/site_domain.py | i18n: translate domain-taken/redirect errors |
| press/press/doctype/site_database_user/site_database_user.py | i18n: translate DB user validation/errors |
| press/press/doctype/site_backup/site_backup.py | i18n: translate backup validation errors |
| press/press/doctype/site_action_step/site_action_step.py | i18n: translate async validation error |
| press/press/doctype/site_action/site_action.py | i18n: translate permission/validation errors; clone suffix adjusted |
| press/press/doctype/site/site.py | i18n: translate many site validation/runtime errors |
| press/press/doctype/silenced_alert/silenced_alert.py | i18n + minor formatting changes |
| press/press/doctype/server_storage_plan/server_storage_plan.py | i18n: translate single-enabled-plan error |
| press/press/doctype/server_snapshot_recovery/server_snapshot_recovery.py | i18n: translate snapshot recovery errors |
| press/press/doctype/server_snapshot/server_snapshot.py | i18n: translate snapshot validations/errors |
| press/press/doctype/server/server.py | i18n: translate server action/validation errors |
| press/press/doctype/self_hosted_server/test_self_hosted_server.py | i18n attempt in test helper (currently broken) |
| press/press/doctype/self_hosted_server/self_hosted_server.py | i18n: translate self-hosted workflow errors |
| press/press/doctype/release_group/release_group.py | i18n: translate validation errors (some string interpolation changes) |
| press/press/doctype/registry_server/registry_server.py | i18n: translate config update error |
| press/press/doctype/proxy_server/test_proxy_server.py | i18n used in autoname pattern (problematic) |
| press/press/doctype/proxy_server/proxy_server.py | i18n: translate proxy validations/errors |
| press/press/doctype/proxy_failover/proxy_failover.py | i18n: translate failover validation error |
| press/press/doctype/prometheus_alert_rule/prometheus_alert_rule.py | i18n: translate validation error |
| press/press/doctype/process_snapshot/process_snapshot.py | i18n: translate missing-bench error |
| press/press/doctype/press_webhook/press_webhook.py | i18n: translate webhook validation errors |
| press/press/doctype/press_settings/press_settings.py | i18n: translate settings validation errors |
| press/press/doctype/press_role_permission/press_role_permission.py | i18n: translate permission/duplicate errors |
| press/press/doctype/plan_change/plan_change.py | i18n: translate missing subscription error |
| press/press/doctype/physical_restoration_test/physical_restoration_test.py | i18n: translate “no pending restoration” |
| press/press/doctype/physical_backup_restoration_step/physical_backup_restoration_step.py | i18n: translate async validation error |
| press/press/doctype/physical_backup_restoration/physical_backup_restoration.py | i18n: translate restoration validation errors |
| press/press/doctype/payout_order/payout_order.py | i18n + typing/format tweaks |
| press/press/doctype/payment_due_extension/payment_due_extension.py | i18n: translate validation errors; whitespace cleanup |
| press/press/doctype/on_prem_failover/on_prem_failover.py | i18n: translate replication/failover errors |
| press/press/doctype/nfs_volume_detachment/nfs_volume_detachment.py | i18n: translate validation errors |
| press/press/doctype/mpesa_request_log/mpesa_request_log.py | i18n: translate duplicate request error |
| press/press/doctype/mpesa_payment_record/mpesa_payment_record.py | i18n: translate duplicate transaction error |
| press/press/doctype/monitor_server/monitor_server.py | i18n: translate monitor fetch error |
| press/press/doctype/marketplace_app/marketplace_app.py | i18n: translate marketplace validations |
| press/press/doctype/mariadb_variable/mariadb_variable.py | i18n: translate required default error |
| press/press/doctype/logical_replication_step/logical_replication_step.py | i18n: translate async validation error |
| press/press/doctype/logical_replication_backup/logical_replication_backup.py | i18n: translate replication workflow errors |
| press/press/doctype/invoice/invoice.py | i18n: translate invoice validations/errors |
| press/press/doctype/incident/incident.py | i18n: translate monitor/db/bench errors |
| press/press/doctype/github_webhook_log/github_webhook_log.py | i18n: translate invalid signature error |
| press/press/doctype/downtime_analysis/downtime_analysis.py | i18n: translate date validation errors |
| press/press/doctype/deploy_candidate_build/deploy_candidate_build.py | i18n: translate missing image error |
| press/press/doctype/deploy_candidate/deploy_candidate.py | i18n: translate halted deployments error |
| press/press/doctype/database_server_mariadb_variable/database_server_mariadb_variable.py | i18n: translate validation errors |
| press/press/doctype/database_server/database_server.py | i18n: translate many DB server validation/runtime errors |
| press/press/doctype/communication_info/communication_info.py | i18n: translate communication validation errors |
| press/press/doctype/code_server/code_server.py | i18n: translate validation errors |
| press/press/doctype/cluster/cluster.py | i18n: translate provisioning/validation errors |
| press/press/doctype/build_cache_shell/build_cache_shell.py | i18n: translate missing build server error |
| press/press/doctype/bench_update/bench_update.py | i18n: translate pending deploy/update errors |
| press/press/doctype/bench/bench.py | i18n: translate bench validation/runtime errors |
| press/press/doctype/balance_transaction/balance_transaction.py | i18n: translate validation errors |
| press/press/doctype/backup_restoration_test/backup_restoration_test.py | i18n: translate duplicate test errors |
| press/press/doctype/auto_scale_record/auto_scale_record.py | i18n: translate scheduling/validation errors |
| press/press/doctype/app_source/app_source.py | i18n: translate duplicate version error |
| press/press/doctype/app_release_difference/app_release_difference.py | i18n: translate validation errors |
| press/press/doctype/app_release_approval_request/app_release_approval_request.py | i18n: translate request validation errors |
| press/press/doctype/app_release/app_release.py | i18n: translate “release not found” error |
| press/press/doctype/app_patch/app_patch.py | i18n: translate bench/patch errors |
| press/press/doctype/ansible_play/ansible_play.py | i18n: translate permission error; header cleanup |
| press/press/doctype/agent_update/agent_update.py | i18n: translate validation/state errors; minor loop var rename |
| press/press/doctype/agent_job/agent_job.py | i18n: translate permission error |
| press/press/doctype/account_request/account_request.py | i18n: translate invalid email error |
| press/partner/doctype/partner_approval_request/partner_approval_request.py | i18n: translate approval request failure |
| press/overrides.py | i18n: translate re-login error |
| press/marketplace/doctype/marketplace_app_subscription/marketplace_app_subscription.py | i18n + minor formatting changes |
| press/infrastructure/doctype/virtual_machine_replacement/virtual_machine_replacement.py | i18n: translate AWS-only/existing replacement errors |
| press/infrastructure/doctype/virtual_machine_migration/virtual_machine_migration.py | i18n: translate AWS-only/existing migration errors |
| press/infrastructure/doctype/virtual_disk_resize/virtual_disk_resize.py | i18n: translate AWS-only/validation errors |
| press/infrastructure/doctype/arm_build_record/arm_build_record.py | i18n: translate build failure error |
| press/guards/settings.py | i18n: translate “feature disabled” error |
| press/auth.py | i18n: translate denied URL error |
| press/api/site_login.py | i18n: translate session/OTP errors (one message needs formatting) |
| press/api/site_backup.py | i18n: translate snapshot creation errors |
| press/api/site.py | i18n: translate many API permission/validation errors |
| press/api/server.py | i18n: translate account/monitoring/scale errors |
| press/api/selfhosted.py | i18n: translate self-hosted validation errors |
| press/api/saas.py | i18n: translate SaaS flow errors |
| press/api/product_trial.py | i18n: translate product trial login/setup errors |
| press/api/partner.py | i18n: translate partner API errors |
| press/api/oauth.py | i18n + minor formatting changes |
| press/api/marketplace.py | i18n: translate marketplace API errors |
| press/api/log_browser.py | i18n: translate invalid log type error |
| press/api/google.py | i18n: translate missing credentials error |
| press/api/github.py | i18n: translate GitHub API errors |
| press/api/email.py | i18n: translate invalid request/send errors |
| press/api/developer/saas.py | i18n: translate SaaS developer login errors |
| press/api/developer/init.py | i18n: translate invalid key error |
| press/api/dashboard.py | i18n: translate duplicate tag error |
| press/api/client.py | i18n: translate client API validation errors |
| press/api/central.py | i18n: translate invalid/expired key error |
| press/api/callbacks.py | i18n: translate callback permission/job errors |
| press/api/billing.py | i18n: translate GST validation errors |
| press/api/bench.py | i18n: translate bench API errors |
| press/api/assets.py | i18n: translate asset API errors |
| press/api/analytics.py | i18n import edit (currently breaks runtime due to missing imports) |
| press/api/account.py | i18n: translate account/OTP/2FA errors |
| press/api/access.py | i18n: translate support access errors |
| press/api/init.py | i18n: translate SSL download errors |
| press/agent.py | i18n: translate offsite backup setup errors |
| .secrets.baseline | baseline metadata updated (line numbers/timestamp) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…lication.py Agent-Logs-Url: https://github.com/frappe/press/sessions/191e6139-f282-41e1-bcc6-1f31a0eca427 Co-authored-by: ssiyad <28098330+ssiyad@users.noreply.github.com>
… team banned message Agent-Logs-Url: https://github.com/frappe/press/sessions/983a4265-2b05-4730-adde-6e4595ce8986 Co-authored-by: ssiyad <28098330+ssiyad@users.noreply.github.com>
…isted Release Group title suffix Agent-Logs-Url: https://github.com/frappe/press/sessions/6840383d-730c-401f-8e20-1d1da2d80334 Co-authored-by: ssiyad <28098330+ssiyad@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates user-facing exception messages across the Press backend to be translatable by wrapping frappe.throw(...) messages with the Frappe translation function (_ / frappe._) and converting many f-strings into placeholder-based .format(...) calls.
Changes:
- Added
from frappe import _imports and wrapped manyfrappe.throw(...)messages in_()for translation. - Replaced several f-string exception messages with static translation keys using
.format(...). - Minor typing/formatting adjustments in a few modules while touching the same lines.
Reviewed changes
Copilot reviewed 134 out of 134 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| press/www/dashboard.py | Translate frappe.throw message in dashboard endpoint. |
| press/workflow_engine/doctype/press_workflow_test/press_workflow_test.py | Translate unit-test-only validation throw. |
| press/workflow_engine/doctype/press_workflow/press_workflow.py | Translate validation throw before running workflow. |
| press/utils/webhook.py | Translate invalid payload type throw. |
| press/utils/extra.py | Translate “disabled” decorator throw message. |
| press/utils/billing.py | Translate billing configuration errors. |
| press/utils/init.py | Translate multiple auth/validation throws; refactor some throw construction. |
| press/saas/doctype/saas_app_subscription/saas_app_subscription.py | Translate plan/app mismatch throw with placeholders. |
| press/saas/doctype/saas_app_plan/saas_app_plan.py | Translate validation throw; minor typing/format updates. |
| press/saas/doctype/product_trial_request/product_trial_request.py | Translate setup wizard payload failure + invalid domain throw. |
| press/saas/doctype/product_trial/product_trial.py | Translate access/validation throws related to trials. |
| press/saas/api/billing.py | Translate invoice-not-found / pdf-not-found throws. |
| press/saas/api/init.py | Translate SaaS auth wrapper throws. |
| press/press/report/press_endpoints_audit/press_endpoints_audit.py | Translate directory access failure throw. |
| press/press/doctype/wireguard_peer/wireguard_peer.py | Translate invalid network throw. |
| press/press/doctype/virtual_machine_image/virtual_machine_image.py | Translate data-volume validation throw. |
| press/press/doctype/virtual_machine/virtual_machine.py | Translate numerous VM validation/provisioning throws. |
| press/press/doctype/virtual_disk_snapshot/virtual_disk_snapshot.py | Translate provider-support throws. |
| press/press/doctype/version_upgrade/version_upgrade.py | Translate maintenance-state throw. |
| press/press/doctype/user_ssh_certificate/user_ssh_certificate.py | Translate SSH cert validation/creation throws. |
| press/press/doctype/tls_certificate/tls_certificate.py | Translate TLS validation/limit/mismatch throws. |
| press/press/doctype/team_deletion_request/team_deletion_request.py | Translate permission/duplicate/outstanding invoice throws. |
| press/press/doctype/team_change/team_change.py | Translate team ownership validation throw. |
| press/press/doctype/team/team.py | Translate multiple team validation/permission throws. |
| press/press/doctype/support_access/support_access.py | Translate status/permission validation throws. |
| press/press/doctype/subscription/subscription.py | Translate duplicate subscription throw w/ placeholders. |
| press/press/doctype/stripe_webhook_log/stripe_webhook_log.py | Translate webhook payload/signature errors. |
| press/press/doctype/ssh_certificate/ssh_certificate.py | Translate SSH cert validation errors; minor formatting. |
| press/press/doctype/site_user/site_user.py | Translate disabled-user throw. |
| press/press/doctype/site_update/site_update.py | Translate site update validation/flow throws. |
| press/press/doctype/site_replication/site_replication.py | Translate replication validation throws; typing/format tweaks. |
| press/press/doctype/site_plan_change/site_plan_change.py | Translate plan-change validation throw. |
| press/press/doctype/site_migration/site_migration.py | Translate migration validation throws. |
| press/press/doctype/site_group_deploy/site_group_deploy.py | Translate duplicate RG/site throws. |
| press/press/doctype/site_domain/site_domain.py | Translate domain conflict/redirect validation throws. |
| press/press/doctype/site_database_user/site_database_user.py | Translate DB user validation/permission throws. |
| press/press/doctype/site_backup/site_backup.py | Translate backup validation/limit throws. |
| press/press/doctype/site_action_step/site_action_step.py | Translate async-step validation throw. |
| press/press/doctype/site_action/site_action.py | Translate action validation/permission throws. |
| press/press/doctype/site/site.py | Translate many site lifecycle validation throws. |
| press/press/doctype/silenced_alert/silenced_alert.py | Translate Alertmanager fetch failures; minor formatting adjustments. |
| press/press/doctype/server_storage_plan/server_storage_plan.py | Translate single-enabled-plan validation throw. |
| press/press/doctype/server_snapshot_recovery/server_snapshot_recovery.py | Translate snapshot recovery validation/download errors. |
| press/press/doctype/server_snapshot/server_snapshot.py | Translate snapshot validation/locking/recovery throws; minor refactor. |
| press/press/doctype/server/server.py | Translate server validation/operational throws. |
| press/press/doctype/self_hosted_server/self_hosted_server.py | Translate some self-hosted validation/operation throws. |
| press/press/doctype/release_group/release_group.py | Translate config/app validation throws; some messages refactored. |
| press/press/doctype/registry_server/registry_server.py | Translate mirror-config validation throw. |
| press/press/doctype/proxy_server/proxy_server.py | Translate SSH proxy + failover validations and limit errors. |
| press/press/doctype/proxy_failover/proxy_failover.py | Translate failover cluster validation throw. |
| press/press/doctype/prometheus_alert_rule/prometheus_alert_rule.py | Translate missing-expression validation throw. |
| press/press/doctype/process_snapshot/process_snapshot.py | Translate bench-existence validation throw. |
| press/press/doctype/press_webhook/press_webhook.py | Translate webhook validation throws (limits, URL checks, duplicates). |
| press/press/doctype/press_settings/press_settings.py | Translate settings validation throws. |
| press/press/doctype/press_role_permission/press_role_permission.py | Translate permission/duplicate role permission throws. |
| press/press/doctype/plan_change/plan_change.py | Translate missing-subscription throw. |
| press/press/doctype/physical_restoration_test/physical_restoration_test.py | Translate “no pending restoration” throw. |
| press/press/doctype/physical_backup_restoration_step/physical_backup_restoration_step.py | Translate async-step validation throw. |
| press/press/doctype/physical_backup_restoration/physical_backup_restoration.py | Translate many restoration validation/flow throws. |
| press/press/doctype/payout_order/payout_order.py | Translate payout validation throws; typing/format tweaks. |
| press/press/doctype/payment_due_extension/payment_due_extension.py | Translate extension validation/duplicate throws; whitespace tweak. |
| press/press/doctype/on_prem_failover/on_prem_failover.py | Translate replication step failure throws. |
| press/press/doctype/nfs_volume_detachment/nfs_volume_detachment.py | Translate validation throws for detachment safeguards. |
| press/press/doctype/mpesa_request_log/mpesa_request_log.py | Translate duplicate request id throw. |
| press/press/doctype/mpesa_payment_record/mpesa_payment_record.py | Translate duplicate transaction throw. |
| press/press/doctype/monitor_server/monitor_server.py | Translate monitor error throw. |
| press/press/doctype/marketplace_app/marketplace_app.py | Translate marketplace app validation/authorization throws. |
| press/press/doctype/mariadb_variable/mariadb_variable.py | Translate missing default value throw. |
| press/press/doctype/logical_replication_step/logical_replication_step.py | Translate async-step validation throw. |
| press/press/doctype/logical_replication_backup/logical_replication_backup.py | Translate multiple logical replication backup errors. |
| press/press/doctype/invoice/invoice.py | Translate invoice validation/duplicate/refund errors. |
| press/press/doctype/incident/incident.py | Translate incident operational errors (monitor/db/down benches). |
| press/press/doctype/github_webhook_log/github_webhook_log.py | Translate signature validation throw. |
| press/press/doctype/downtime_analysis/downtime_analysis.py | Translate date-range validation throws. |
| press/press/doctype/deploy_candidate_build/deploy_candidate_build.py | Translate missing-image error throw. |
| press/press/doctype/deploy_candidate/deploy_candidate.py | Translate halted deployments throw. |
| press/press/doctype/database_server_mariadb_variable/database_server_mariadb_variable.py | Translate validation throws for MariaDB variable records. |
| press/press/doctype/database_server/database_server.py | Translate many DB server validation/operational throws. |
| press/press/doctype/communication_info/communication_info.py | Translate validation + API argument errors. |
| press/press/doctype/code_server/code_server.py | Translate code-server validation throws; minor formatting. |
| press/press/doctype/cluster/cluster.py | Translate cluster validation/provisioning errors; minor refactor. |
| press/press/doctype/build_cache_shell/build_cache_shell.py | Translate build-server requirement throw. |
| press/press/doctype/bench_update/bench_update.py | Translate bench update validation/permission throws. |
| press/press/doctype/bench/bench.py | Translate bench validation/operational throws. |
| press/press/doctype/balance_transaction/balance_transaction.py | Translate amount/unallocated validation throws. |
| press/press/doctype/backup_restoration_test/backup_restoration_test.py | Translate duplicate test/site active throws. |
| press/press/doctype/auto_scale_record/auto_scale_record.py | Translate missing secondary server / scheduling collision throws. |
| press/press/doctype/app_source/app_source.py | Translate duplicate version throw. |
| press/press/doctype/app_release_difference/app_release_difference.py | Translate validation + token lookup failure throw. |
| press/press/doctype/app_release_approval_request/app_release_approval_request.py | Translate approval request existence throws. |
| press/press/doctype/app_release/app_release.py | Translate missing release throw. |
| press/press/doctype/app_patch/app_patch.py | Translate bench/duplicate patch throws. |
| press/press/doctype/ansible_play/ansible_play.py | Translate permission throw; import cleanup. |
| press/press/doctype/agent_update/agent_update.py | Translate various validation/state throws; minor refactors. |
| press/press/doctype/agent_job/agent_job.py | Translate permission throw. |
| press/press/doctype/account_request/account_request.py | Translate invalid email throw. |
| press/partner/doctype/partner_approval_request/partner_approval_request.py | Translate partner approval request failure throw. |
| press/overrides.py | Translate re-login requirement throw. |
| press/marketplace/doctype/marketplace_app_subscription/marketplace_app_subscription.py | Translate “already active” throw; minor formatting changes. |
| press/infrastructure/doctype/virtual_machine_replacement/virtual_machine_replacement.py | Translate AWS-only + duplicate replacement errors. |
| press/infrastructure/doctype/virtual_machine_migration/virtual_machine_migration.py | Translate AWS-only + duplicate migration errors. |
| press/infrastructure/doctype/virtual_disk_resize/virtual_disk_resize.py | Translate AWS-only + shrink/size validation errors. |
| press/infrastructure/doctype/arm_build_record/arm_build_record.py | Translate failed build precondition throw. |
| press/guards/settings.py | Translate feature-disabled throw in guard wrapper. |
| press/auth.py | Translate auth denied-path throws. |
| press/api/site_login.py | Translate SaaS/site user session/auth throws. |
| press/api/site_backup.py | Translate snapshot creation error cases. |
| press/api/site.py | Translate multiple API authorization/validation throws. |
| press/api/server.py | Translate server creation/auth/monitor errors and schedule validation. |
| press/api/selfhosted.py | Translate self-hosted validation/verification throws. |
| press/api/saas.py | Translate SaaS signup validation throws. |
| press/api/product_trial.py | Translate product trial login/setup validation throws. |
| press/api/partner.py | Translate partner API permission/lookup/transfer validation throws. |
| press/api/oauth.py | Translate SaaS setup validation throws; minor formatting. |
| press/api/marketplace.py | Translate marketplace API validation/permission throws. |
| press/api/log_browser.py | Translate invalid log type throw. |
| press/api/google.py | Translate missing config throw. |
| press/api/github.py | Translate GitHub API error throws; placeholder formatting improvements. |
| press/api/email.py | Translate invalid request + email send error formatting. |
| press/api/developer/saas.py | Translate developer SaaS login flow throws. |
| press/api/developer/init.py | Translate invalid secret key throw. |
| press/api/dashboard.py | Translate duplicate tag throw. |
| press/api/client.py | Translate child-table validation throws and “not permitted”. |
| press/api/central.py | Translate invalid/expired key throw. |
| press/api/callbacks.py | Translate callback permission/job id validation throws. |
| press/api/billing.py | Translate GST validation throws. |
| press/api/bench.py | Translate bench API validation/permission throws. |
| press/api/assets.py | Translate asset upload/credential errors. |
| press/api/analytics.py | Translate several report/metrics validation throws. |
| press/api/account.py | Translate many OTP/account validation throws. |
| press/api/access.py | Translate support-access permission errors. |
| press/api/init.py | Translate SSL cert download validation/errors. |
| press/agent.py | Translate offsite backups setup errors. |
| .secrets.baseline | Updated secrets baseline metadata (line numbers / timestamp). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| site_apps = [app.app for app in self.apps] | ||
| if len(site_apps) != len(set(site_apps)): | ||
| frappe.throw("App {app.app} is already on installed on the bench. Cannot add the same app twice") | ||
| frappe.throw( | ||
| _("App {app.app} is already on installed on the bench. Cannot add the same app twice") | ||
| ) |
| if frappe.db.exists("Site", {"name": site_name, "bench": self.bench}): | ||
| frappe.throw(f"Another site already exists in {self.bench} with name: {site_name}.") # nosemgrep | ||
| frappe.throw( | ||
| _(f"Another site already exists in {self.bench} with name: {site_name}.") | ||
| ) # nosemgrep |
There was a problem hiding this comment.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
Fixed in 3449c64 — replaced _(f"Another site already exists in {self.bench} with name: {site_name}.") with _("Another site already exists in {0} with name: {1}.").format(self.bench, site_name) for a static, extractable translation key.
| def validate_marketplace_app_plan(self): | ||
| app = frappe.db.get_value("Marketplace App Plan", self.marketplace_app_plan, "app") | ||
|
|
||
| if app != self.app: | ||
| frappe.throw( | ||
| f"Plan {self.marketplace_app_plan} is not for app {frappe.bold(self.app)}!" | ||
| ) | ||
| frappe.throw(f"Plan {self.marketplace_app_plan} is not for app {frappe.bold(self.app)}!") | ||
|
|
| all_countries = frappe.db.get_all("Country", pluck="name") | ||
| country = find(all_countries, lambda x: x.lower() == country.lower()) | ||
| if not country: | ||
| frappe.throw("{country} is not a valid country. Please choose the correct country value.") | ||
| frappe.throw(_("{country} is not a valid country. Please choose the correct country value.")) |
| if team and frappe.db.exists("Invoice", {"team": team, "status": "Unpaid", "type": "Subscription"}): | ||
| frappe.throw(f"Account {email} already exists with unpaid invoices. Please clear the previous dues.") | ||
| frappe.throw( | ||
| _(f"Account {email} already exists with unpaid invoices. Please clear the previous dues.") |
| if self.skip and not self.skippable: | ||
| frappe.throw(f"Only skippable variables can be skipped. {self.mariadb_variable} is not skippable") | ||
| frappe.throw( | ||
| _(f"Only skippable variables can be skipped. {self.mariadb_variable} is not skippable") | ||
| ) |
| if env_var.internal: | ||
| frappe.throw(f"Environment variable {env_var.key} is internal and cannot be updated") | ||
| frappe.throw( | ||
| _(f"Environment variable {env_var.key} is internal and cannot be updated") | ||
| ) |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
….py retry_archive Agent-Logs-Url: https://github.com/frappe/press/sessions/58140e3c-64ac-4fb9-acf2-fd75d4a47066 Co-authored-by: ssiyad <28098330+ssiyad@users.noreply.github.com>
No description provided.