Open Raruto opened 1 year ago
Here's what I get instead after clicking on delete link (when trying to upload a new *.qgs
file)
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 media
folder. It can only happen by manually deleting the file from the folder
It can only happen by manually deleting the file from the folder
I've inadvertently deleted the /shared-volume/
folder while migrating from v3.5 to v3.6 and then i tried to restore it but, if I remember correctly, in such cases the only way to fix is to manually re-upload / individually save all the projects via the graphical interface (that means, even if you re-upload the /shared-volume/media/projects/
folder via FTP, the system is no longer able to link these files to your qdjango projects).
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/