-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gracefully handle missing project files (ref: /media/*.qgs
files)
#542
Comments
Here's what I get instead after clicking on delete link (when trying to upload a new 2023-05-03 14:56:39 WARNING:root:Could not resolve form field 'delete_url'.
2023-05-03 14:56:39 Traceback (most recent call last):
2023-05-03 14:56:39 File "/usr/local/lib/python3.10/dist-packages/django/forms/forms.py", line 153, in __getitem__
2023-05-03 14:56:39 field = self.fields[name]
2023-05-03 14:56:39 KeyError: 'delete_url'
2023-05-03 14:56:39
2023-05-03 14:56:39 During handling of the above exception, another exception occurred:
2023-05-03 14:56:39
2023-05-03 14:56:39 Traceback (most recent call last):
2023-05-03 14:56:39 File "/usr/local/lib/python3.10/dist-packages/crispy_forms/utils.py", line 80, in render_field
2023-05-03 14:56:39 bound_field = form[field]
2023-05-03 14:56:39 File "/usr/local/lib/python3.10/dist-packages/django/forms/forms.py", line 155, in __getitem__
2023-05-03 14:56:39 raise KeyError(
2023-05-03 14:56:39 KeyError: "Key 'delete_url' not found in 'QdjangoProjectForm'. Choices are: authentication_id, authentication_password, authentication_username, autozoom_query, baselayer, context_base_legend, description, editor2_user, editor_user, editor_user_groups, feature_count_wms, form_id, legend_position, multilayer_query, multilayer_querybybbox, multilayer_querybypolygon, propagate_viewers, qgis_file, qgis_file-metadata, qgis_file-uploads, thumbnail, thumbnail-metadata, thumbnail-uploads, title_ur, toc_layers_init_status, toc_tab_default, toc_themes_init_status, upload_url, url_alias, use_map_extent_as_init_extent, viewer_user_groups, viewer_users." So, now it seems impossible to upload a new file: |
This is an edge case, because it is highly unlikely that a project will be deleted from the |
I've inadvertently deleted the BTW, then to make it faster I simply performed a database reset (anyway, at least when a file is missing the system shouldn't crash..) |
Checklist
Subject of the issue
Consider sending a more meaningful error message to the client when for some strange reason a user tries to access a project (whose
*.qgs
) no longer exists on the server.Right now, you get a generic server error message at client side:
Steps to reproduce
buildings_legend-feature-count.qgs
file through the integrated file manager)/shared-volume/media/projects/buildings_legend-feature-count.qgs
Environment
Link to your project
http://localhost:8000/en/admin/qdjango/buildings/projects/update/public-building-management-demo/
Additional info
Docker compose log
here's what you get when you request the following page at client-side: http://localhost:8000/en/map/buildings/qdjango/1/
The text was updated successfully, but these errors were encountered: