datasource: use only underscore in slug (#54979)
This commit is contained in:
parent
032b9c8da3
commit
66b15214ca
|
@ -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/')
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue