From 7604a832240d35beeeca58a439af19422433b6e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20P=C3=A9rez=20Sampayo?= Date: Tue, 26 Mar 2024 13:48:48 +0100 Subject: [PATCH] Clean django code --- django_project/geosight/data/models/context_layer.py | 7 ++----- django_project/geosight/data/serializer/context_layer.py | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/django_project/geosight/data/models/context_layer.py b/django_project/geosight/data/models/context_layer.py index 8162017a0..a193d2611 100644 --- a/django_project/geosight/data/models/context_layer.py +++ b/django_project/geosight/data/models/context_layer.py @@ -74,7 +74,8 @@ class ContextLayer(AbstractEditData, AbstractTerm): blank=True, max_length=10240, help_text=( - "Put full url with parameters that are needed. Not necesary for Related Table Layer Type." + 'Put full url with parameters that are needed. ' + 'Not necesary for Related Table Layer Type.' ) ) layer_type = models.CharField( @@ -168,10 +169,6 @@ class ContextLayer(AbstractEditData, AbstractTerm): objects = models.Manager() permissions = PermissionManager() - def clean(self): - if self.layer_type != LayerType.RELATED_TABLE and self.url is None: - raise ValidationError('Url is mandatory for non related table layer type.') - def save_relations(self, data): """Save all relationship data.""" self.contextlayerfield_set.all().delete() diff --git a/django_project/geosight/data/serializer/context_layer.py b/django_project/geosight/data/serializer/context_layer.py index 351d89a5d..5b36c34c0 100644 --- a/django_project/geosight/data/serializer/context_layer.py +++ b/django_project/geosight/data/serializer/context_layer.py @@ -20,7 +20,6 @@ from rest_framework import serializers from core.serializer.dynamic_serializer import DynamicModelSerializer -from geosight.data.models import RelatedTableRow from geosight.data.models.context_layer import ( ContextLayer, ContextLayerField )