Skip to content

Commit

Permalink
Fix crash with f string expression (#628)
Browse files Browse the repository at this point in the history
avoid using quote as delimiter and inside f string expression
  • Loading branch information
ValentinBuira authored Oct 2, 2024
1 parent e5bf250 commit 628f67f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Mergin/projects_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def create_project(self, project_name, project_dir, is_public, namespace):
)
elif e.server_code == ErrorCode.StorageLimitHit.value:
msg = (
f"{e.detail}]\nCurrent limit: {bytes_to_human_size(dlg.exception.server_response["storage_limit"])}"
f"{e.detail}\nCurrent limit: {bytes_to_human_size(dlg.exception.server_response['storage_limit'])}"
)

QMessageBox.critical(None, "Create Project", "Failed to create Mergin Maps project.\n" + msg)
Expand Down Expand Up @@ -375,7 +375,7 @@ def sync_project(self, project_dir, project_name=None):
# To note we check for a string since error in flask doesn't return server error code
msg = "Somebody else is syncing, please try again later"
elif dlg.exception.server_code == ErrorCode.StorageLimitHit.value:
msg = f"{e.detail}]\nCurrent limit: {bytes_to_human_size(dlg.exception.server_response["storage_limit"])}"
msg = f"{e.detail}\nCurrent limit: {bytes_to_human_size(dlg.exception.server_response['storage_limit'])}"
else:
msg = str(dlg.exception)
QMessageBox.critical(None, "Project sync", "Client error: \n" + msg)
Expand Down

0 comments on commit 628f67f

Please sign in to comment.