misc: enable support for custom id template by default (#87317)
gitea/wcs/pipeline/head This commit looks good Details

This commit is contained in:
Frédéric Péters 2024-02-22 10:31:17 +01:00
parent 2d619766b7
commit d2b95ce0d0
2 changed files with 11 additions and 10 deletions

View File

@ -404,16 +404,6 @@ def test_card_id_template(pub):
carddata.store()
app = login(get_app(pub))
resp = app.get('/backoffice/cards/1/')
resp = resp.click('Templates')
assert 'id_template' not in resp.text
if not pub.site_options.has_section('options'):
pub.site_options.add_section('options')
pub.site_options.set('options', 'enable-card-identifier-template', 'true')
with open(os.path.join(pub.app_dir, 'site-options.cfg'), 'w') as fd:
pub.site_options.write(fd)
resp = app.get('/backoffice/cards/1/')
resp = resp.click('Templates')
assert 'Identifier cannot be modified if there are existing cards.' in resp.text
@ -437,6 +427,16 @@ def test_card_id_template(pub):
carddata.store()
assert carddata.id_display == 'XbarY'
# check option is not advertised if disabled
if not pub.site_options.has_section('options'):
pub.site_options.add_section('options')
pub.site_options.set('options', 'enable-card-identifier-template', 'false')
with open(os.path.join(pub.app_dir, 'site-options.cfg'), 'w') as fd:
pub.site_options.write(fd)
resp = app.get('/backoffice/cards/1/')
resp = resp.click('Templates')
assert 'id_template' not in resp.text
def test_card_digest_template(pub):
create_superuser(pub)

View File

@ -442,6 +442,7 @@ class QommonPublisher(Publisher):
'allow-tracking-code-in-url': 'true',
'disabled-fields': 'ranked-items, table, table-select, tablerows',
'disable-rtf-support': 'true',
'enable-card-identifier-template': 'true',
'enable-intermediate-anonymisation': 'true',
'relatable-hosts': '',
'sync-map-and-address-fields': 'true',