diff --git a/config/api.py b/config/api.py index f7a5270a8..8f909e728 100644 --- a/config/api.py +++ b/config/api.py @@ -1,8 +1,9 @@ API_VERSIONS = ['0.3', '0.4'] API_CONTEXT = { - 'LPF': 'https://raw.githubusercontent.com/LinkedPasts/linked-places/' - 'master/linkedplaces-context-v1.1.jsonld', + 'LPF': + 'https://raw.githubusercontent.com/LinkedPasts/linked-places/' + 'master/linkedplaces-context-v1.1.jsonld', 'LOUD': 'https://linked.art/ns/v1/linked-art.json'} CORS_ALLOWANCE = '*' # Cross-Origin source (CORS) @@ -28,7 +29,10 @@ 'entitySystemClass', 'typeName', 'typeNameWithSubs', 'beginFrom', 'beginTo', 'endFrom', 'endTo'] INT_CATEGORIES: list[str] = [ - 'entityID', 'typeID', 'typeIDWithSubs', 'relationToID'] + 'entityID', + 'typeID', + 'typeIDWithSubs', + 'relationToID'] SET_CATEGORIES: list[str] = ['valueTypeID'] VALID_CATEGORIES: list[str] = [ *STR_CATEGORIES, diff --git a/config/database_versions.py b/config/database_versions.py index e1f6abac7..597fcdaf3 100644 --- a/config/database_versions.py +++ b/config/database_versions.py @@ -1,4 +1,4 @@ -# Used for automatic database upgrades and database version checks +# Used for automatic database upgrades and version checks DATABASE_VERSIONS = [ '8.0.0', '7.17.0', diff --git a/openatlas/database/entity.py b/openatlas/database/entity.py index 93f5a0e58..c64feb79b 100644 --- a/openatlas/database/entity.py +++ b/openatlas/database/entity.py @@ -337,8 +337,7 @@ def get_subunits_without_super(classes: list[str]) -> list[int]: """ SELECT e.id FROM model.entity e - JOIN model.link l ON e.id = l.range_id - AND l.property_code = 'P46' + JOIN model.link l ON e.id = l.range_id AND l.property_code = 'P46' WHERE e.openatlas_class_name IN %(classes)s; """, {'classes': tuple(classes)}) diff --git a/openatlas/database/link.py b/openatlas/database/link.py index a5aeecf9e..e86b2ed89 100644 --- a/openatlas/database/link.py +++ b/openatlas/database/link.py @@ -250,5 +250,6 @@ def check_single_type_duplicates(ids: list[int]) -> list[int]: WHERE property_code = 'P2' AND range_id IN %(ids)s GROUP BY domain_id HAVING COUNT(*) > 1; - """, {'ids': tuple(ids)}) + """, + {'ids': tuple(ids)}) return [row['domain_id'] for row in g.cursor.fetchall()] diff --git a/openatlas/database/network.py b/openatlas/database/network.py index 638971887..8b81a84f6 100644 --- a/openatlas/database/network.py +++ b/openatlas/database/network.py @@ -12,7 +12,8 @@ def get_ego_network(ids: set[int]) -> list[dict[str, Any]]: SELECT id, domain_id, property_code, range_id FROM model.link WHERE domain_id IN %(ids)s or range_id IN %(ids)s; - """, {'ids': tuple(ids)}) + """, + {'ids': tuple(ids)}) return [dict(row) for row in g.cursor.fetchall()] @staticmethod