Change workbench_lite for schema_workbench

This commit is contained in:
Cayo Puigdefabregas 2022-05-16 17:57:09 +02:00
parent b309cc4410
commit 960c971197
3 changed files with 4 additions and 4 deletions

View File

@ -63,7 +63,7 @@ class DevicehubConfig(Config):
"""The minimum version of ereuse.org workbench that this devicehub """The minimum version of ereuse.org workbench that this devicehub
accepts. we recommend not changing this value. accepts. we recommend not changing this value.
""" """
WORKBENCH_LITE = ["1.0.0"] SCHEMA_WORKBENCH = ["1.0.0"]
TMP_SNAPSHOTS = config('TMP_SNAPSHOTS', '/tmp/snapshots') TMP_SNAPSHOTS = config('TMP_SNAPSHOTS', '/tmp/snapshots')
TMP_LIVES = config('TMP_LIVES', '/tmp/lives') TMP_LIVES = config('TMP_LIVES', '/tmp/lives')

View File

@ -275,7 +275,7 @@ class UploadSnapshotForm(SnapshotMixin, FlaskForm):
def is_wb_lite_snapshot(self, version: str) -> bool: def is_wb_lite_snapshot(self, version: str) -> bool:
is_lite = False is_lite = False
if version in app.config['WORKBENCH_LITE']: if version in app.config['SCHEMA_WORKBENCH']:
is_lite = True is_lite = True
return is_lite return is_lite

View File

@ -26,11 +26,11 @@ class Snapshot_lite(Thing):
@validates_schema @validates_schema
def validate_workbench_version(self, data: dict): def validate_workbench_version(self, data: dict):
if data['schema_api'] not in app.config['WORKBENCH_LITE']: if data['schema_api'] not in app.config['SCHEMA_WORKBENCH']:
raise ValidationError( raise ValidationError(
'Min. supported Workbench version is ' 'Min. supported Workbench version is '
'{} but yours is {}.'.format( '{} but yours is {}.'.format(
app.config['WORKBENCH_LITE'][0], data['version'] app.config['SCHEMA_WORKBENCH'][0], data['version']
), ),
field_names=['version'], field_names=['version'],
) )