From ee044ce983e7552a56379c7b93f6e6bc9dfc47e6 Mon Sep 17 00:00:00 2001 From: Suryashankar Das Date: Thu, 18 Aug 2022 19:50:11 +0530 Subject: [PATCH] make camera_type optional for onvif meta --- .../migrations/0309_auto_20220818_1949.py | 20 +++++++++++++++++++ care/facility/models/json_schema/asset.py | 1 - 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 care/facility/migrations/0309_auto_20220818_1949.py diff --git a/care/facility/migrations/0309_auto_20220818_1949.py b/care/facility/migrations/0309_auto_20220818_1949.py new file mode 100644 index 0000000000..c5ba04b1c0 --- /dev/null +++ b/care/facility/migrations/0309_auto_20220818_1949.py @@ -0,0 +1,20 @@ +# Generated by Django 2.2.11 on 2022-08-18 14:19 + +import care.utils.models.validators +import django.contrib.postgres.fields.jsonb +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('facility', '0308_auto_20220805_2247'), + ] + + operations = [ + migrations.AlterField( + model_name='asset', + name='meta', + field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict, validators=[care.utils.models.validators.JSONFieldSchemaValidator({'$schema': 'http://json-schema.org/draft-07/schema#', 'anyOf': [{'$ref': '#/definitions/onvif'}, {'$ref': '#/definitions/hl7monitor'}, {'$ref': '#/definitions/empty'}], 'definitions': {'empty': {'additionalProperties': False, 'type': 'object'}, 'hl7monitor': {'additionalProperties': False, 'properties': {'asset_type': {'type': 'string'}, 'insecure_connection': {'type': 'boolean'}, 'local_ip_address': {'type': 'string'}, 'middleware_hostname': {'type': 'string'}}, 'required': ['local_ip_address', 'middleware_hostname'], 'type': 'object'}, 'onvif': {'additionalProperties': False, 'properties': {'asset_type': {'type': 'string'}, 'camera_access_key': {'type': 'string'}, 'camera_type': {'type': 'string'}, 'insecure_connection': {'type': 'boolean'}, 'local_ip_address': {'type': 'string'}, 'middleware_hostname': {'type': 'string'}}, 'required': ['local_ip_address', 'middleware_hostname', 'camera_access_key'], 'type': 'object'}}})]), + ), + ] diff --git a/care/facility/models/json_schema/asset.py b/care/facility/models/json_schema/asset.py index c112a9c513..1be20cd742 100644 --- a/care/facility/models/json_schema/asset.py +++ b/care/facility/models/json_schema/asset.py @@ -16,7 +16,6 @@ "local_ip_address", "middleware_hostname", "camera_access_key", - "camera_type", ], "properties": { "local_ip_address": {"type": "string"},