Closed wlorenzetti closed 2 months ago
switch from Base map
to administrative
all the categories are enabled
Nothing happens when you try to create a new theme via an anonymous user:
Request:
POST http://localhost:8000/qdjango/api/prjtheme/3/foo/
{
"layerstree": [
{
"name": "Geographical group",
"checked": true,
"expanded": true,
"mutually-exclusive": false,
"nodes": [
{
"id": "buildings_2f43dc1d_6725_42d2_a09b_dd446220104a",
"name": "buildings",
"visible": true,
"expanded": true
},
{
"id": "roads_ea006d6f_bd87_4635_aae0_4e9e7842b3f4",
"name": "roads",
"visible": true,
"expanded": true
},
{
"id": "work_areas_f0ecbe28_cbd1_4a38_8a57_ab6da91473fe",
"name": "Work areas",
"visible": true,
"expanded": true
},
{
"id": "type_subtype_caec4a0b_e7c4_4542_b59c_769f2033d6b1",
"name": "Type - Subtype",
"visible": true,
"expanded": true
}
]
},
{
"name": "1:N referencing tables",
"checked": true,
"expanded": true,
"mutually-exclusive": false,
"nodes": [
{
"id": "maintenance_works_f8cbe34a_eebe_4cd1_9c78_5d420ab0af63",
"name": "Maintenance works",
"visible": true,
"expanded": true
},
{
"id": "buildings_rating_3d535fae_fd04_4df6_b6ff_8cbd13df078f",
"name": "Buildings rating",
"visible": true,
"expanded": true
}
]
}
],
"styles": {
"buildings_2f43dc1d_6725_42d2_a09b_dd446220104a": "Categorized",
"roads_ea006d6f_bd87_4635_aae0_4e9e7842b3f4": "default",
"work_areas_f0ecbe28_cbd1_4a38_8a57_ab6da91473fe": "default",
"type_subtype_caec4a0b_e7c4_4542_b59c_769f2033d6b1": "default",
"maintenance_works_f8cbe34a_eebe_4cd1_9c78_5d420ab0af63": "default",
"buildings_rating_3d535fae_fd04_4df6_b6ff_8cbd13df078f": "default"
}
}
Response:
{
"result": false,
"error": "Field 'id' expected a number but got <django.contrib.auth.models.AnonymousUser object at 0x7f4826a353c0>."
}
KO: no error message shown to anonymous user
Nothing happens when you try to create a new theme via an anonymous user:
Request:
POST http://localhost:8000/qdjango/api/prjtheme/3/foo/ { "layerstree": [ { "name": "Geographical group", "checked": true, "expanded": true, "mutually-exclusive": false, "nodes": [ { "id": "buildings_2f43dc1d_6725_42d2_a09b_dd446220104a", "name": "buildings", "visible": true, "expanded": true }, { "id": "roads_ea006d6f_bd87_4635_aae0_4e9e7842b3f4", "name": "roads", "visible": true, "expanded": true }, { "id": "work_areas_f0ecbe28_cbd1_4a38_8a57_ab6da91473fe", "name": "Work areas", "visible": true, "expanded": true }, { "id": "type_subtype_caec4a0b_e7c4_4542_b59c_769f2033d6b1", "name": "Type - Subtype", "visible": true, "expanded": true } ] }, { "name": "1:N referencing tables", "checked": true, "expanded": true, "mutually-exclusive": false, "nodes": [ { "id": "maintenance_works_f8cbe34a_eebe_4cd1_9c78_5d420ab0af63", "name": "Maintenance works", "visible": true, "expanded": true }, { "id": "buildings_rating_3d535fae_fd04_4df6_b6ff_8cbd13df078f", "name": "Buildings rating", "visible": true, "expanded": true } ] } ], "styles": { "buildings_2f43dc1d_6725_42d2_a09b_dd446220104a": "Categorized", "roads_ea006d6f_bd87_4635_aae0_4e9e7842b3f4": "default", "work_areas_f0ecbe28_cbd1_4a38_8a57_ab6da91473fe": "default", "type_subtype_caec4a0b_e7c4_4542_b59c_769f2033d6b1": "default", "maintenance_works_f8cbe34a_eebe_4cd1_9c78_5d420ab0af63": "default", "buildings_rating_3d535fae_fd04_4df6_b6ff_8cbd13df078f": "default" } }
Response:
{ "result": false, "error": "Field 'id' expected a number but got <django.contrib.auth.models.AnonymousUser object at 0x7f4826a353c0>." }
The save of theme by anonymous user it is not allowed and makes no sense, no?
@wlorenzetti what am I doing wrong?
[g3wsdk.info]
https://github.com/g3w-suite/g3w-admin/pull/813#issuecomment-2069044558
pip3 install -r /code/requirements.txt
Ref: https://github.com/g3w-suite/g3w-admin/pull/813/commits/34495154e470a9740ca0ad9f68c9e5e086813422
Related to: https://github.com/g3w-suite/g3w-client/pull/540
Closes: #812
CRUD actions
Create/Update
POST
/qdjango/api/prjtheme/<project_id>/<theme_name>/
Body request application/json content example:
Response:
Delete
DELETE
/qdjango/api/prjtheme/<project_id>/<theme_name>/
Response:
Project Config
map_themes
structure:Refactoring of the
/config/api/<group_id>/<project_type>/<project_id>
API REST resultmap_themes
property: I.e.: