Skip to content

Commit

Permalink
Add : . = , to qdjango-prjtheme-api url. (#678)
Browse files Browse the repository at this point in the history
Co-authored-by: wlorenzetti <[email protected]>
  • Loading branch information
wlorenzetti and wlorenzetti authored Nov 29, 2023
1 parent 1956831 commit 16afdc7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion g3w-admin/qdjango/apiurls.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
name='qdjango-asgeotiff-api'
),
re_path(
r'^api/prjtheme/(?P<project_id>\d+)/(?P<theme_name>[-_\w\d\s]+)/$',
r'^api/prjtheme/(?P<project_id>\d+)/(?P<theme_name>[-_\w\d\s:.=,]+)/$',
QdjangoPrjThemeAPIview.as_view(),
name='qdjango-prjtheme-api'
),
Expand Down
7 changes: 7 additions & 0 deletions g3w-admin/qdjango/tests/test_theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ def test_prjtheme_api(self):
self.assertFalse(jres['result'])
self.assertEqual(jres['error'], f"Themes are not available for project {self.project.instance.title}")

# Test theme with special characters: :,.,=
response = self._testApiCall('qdjango-prjtheme-api',
args=[self.project.instance.pk, 'Tav.01: streets, points'])
jres = json.loads(response.content)
self.assertFalse(jres['result'])
self.assertEqual(jres['error'], f"Themes are not available for project {self.project.instance.title}")

# Test view not into project
response = self._testApiCall('qdjango-prjtheme-api',
args=[self.project_theme316.instance.pk, 'Faketheme'])
Expand Down

0 comments on commit 16afdc7

Please sign in to comment.