data sources: don't use dashes in named data source slugs (#7847)
This commit is contained in:
parent
f536d3dbc2
commit
6c3777c076
|
@ -187,3 +187,9 @@ def test_data_source_substitution_variables():
|
|||
context = pub.substitutions.get_context_variables()
|
||||
assert context.get('data_source').foobar == [
|
||||
{'id': 'un', 'text': 'un'}, {'id': 'deux', 'text': 'deux'}]
|
||||
|
||||
def test_data_source_slug_name():
|
||||
NamedDataSource.wipe()
|
||||
data_source = NamedDataSource(name='foo bar')
|
||||
data_source.store()
|
||||
assert data_source.slug == 'foo_bar'
|
||||
|
|
|
@ -198,7 +198,7 @@ class NamedDataSource(XmlStorableObject):
|
|||
super(NamedDataSource, self).store()
|
||||
|
||||
def get_new_slug(self):
|
||||
new_slug = qommon.misc.simplify(self.name)
|
||||
new_slug = qommon.misc.simplify(self.name, space='_')
|
||||
base_new_slug = new_slug
|
||||
suffix_no = 0
|
||||
while True:
|
||||
|
|
Loading…
Reference in New Issue