datasource: use only underscore in slug (#54979)

This commit is contained in:
Thomas NOËL 2021-06-18 12:01:53 +02:00
parent 032b9c8da3
commit 66b15214ca
2 changed files with 2 additions and 2 deletions

View File

@ -567,7 +567,7 @@ def test_data_sources_import(pub):
assert NamedDataSource.count() == 3
assert NamedDataSource.get(1).slug == 'baaaz'
assert NamedDataSource.get(2).slug == 'foobar'
assert NamedDataSource.get(3).slug == 'foobar-1'
assert NamedDataSource.get(3).slug == 'foobar_1'
# import an invalid file
resp = app.get('/backoffice/settings/data-sources/')

View File

@ -559,7 +559,7 @@ class NamedDataSource(XmlStorableObject):
if obj.id == self.id:
break
suffix_no += 1
new_slug = '%s-%s' % (base_new_slug, suffix_no)
new_slug = '%s_%s' % (base_new_slug, suffix_no)
return new_slug
def get_admin_url(self):