From 47038917365c6e4de78a8e89e26dce0d2395fe98 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 21 Mar 2019 15:19:57 +0100 Subject: Fix get_town_polygon duplicate code --- archaeological_operations/models.py | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'archaeological_operations/models.py') diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index fbc36dcef..b3e137399 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -395,13 +395,6 @@ class ArchaeologicalSite(DocumentItem, BaseHistorizedItem, QRCodeItem, return return q.all()[0].poly, self._meta.verbose_name - def get_town_polygons(self): - q = self.towns.filter(limit__isnull=False).annotate( - poly=Union('limit')).all() - if not q.count(): - return None - return q.all()[0].poly - def _get_base_image_path(self): return "{}/{}".format(self.SLUG, self.reference) @@ -1135,13 +1128,6 @@ class Operation(ClosedItem, DocumentItem, BaseHistorizedItem, QRCodeItem, return None return q.all()[0].poly, self._meta.verbose_name - def get_town_polygons(self): - q = self.towns.filter(limit__isnull=False).annotate( - poly=Union('limit')).all() - if not q.count(): - return None - return q.all()[0].poly - def context_record_relations_q(self): from archaeological_context_records.models \ import RecordRelations as CRRL -- cgit v1.2.3