Skip to content

Commit 671d21a

Browse files
committed
fix: exclude dictionary
1 parent 8362e3a commit 671d21a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

backend/apps/api/v1/models.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def entities(self) -> list[dict]:
652652
def contains_open_data(self):
653653
"""Returns true if there are tables or columns with open coverages"""
654654
open_data = False
655-
tables = self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").all()
655+
tables = self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").exclude(slug="dictionary").all()
656656
for table in tables:
657657
table_coverages = table.coverages.filter(is_closed=False)
658658
if table_coverages:
@@ -663,15 +663,15 @@ def contains_open_data(self):
663663
@property
664664
def contains_closed_data(self):
665665
"""Returns true if there are tables or columns with closed coverages, or if the uncompressed file size is above 1 GB"""
666-
for table in self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").all():
666+
for table in self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").exclude(slug="dictionary").all():
667667
if table.contains_closed_data:
668668
return True
669669
return False
670670

671671
@property
672672
def contains_tables(self):
673673
"""Returns true if there are tables in the dataset"""
674-
return len(self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").all()) > 0
674+
return len(self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").exclude(slug="dictionary").all()) > 0
675675

676676
@property
677677
def contains_raw_data_sources(self):
@@ -685,7 +685,7 @@ def contains_information_requests(self):
685685

686686
@property
687687
def n_tables(self):
688-
return len(self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").all())
688+
return len(self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").exclude(slug="dictionary").all())
689689

690690
@property
691691
def n_raw_data_sources(self):
@@ -697,18 +697,18 @@ def n_information_requests(self):
697697

698698
@property
699699
def first_table_id(self):
700-
if resource := self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").order_by("order").first():
700+
if resource := self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").exclude(slug="dictionary").order_by("order").first():
701701
return resource.pk
702702

703703
@property
704704
def first_open_table_id(self):
705-
for resource in self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").order_by("order").all():
705+
for resource in self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").exclude(slug="dictionary").order_by("order").all():
706706
if resource.contains_open_data:
707707
return resource.pk
708708

709709
@property
710710
def first_closed_table_id(self):
711-
for resource in self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").order_by("order").all():
711+
for resource in self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").exclude(slug="dictionary").order_by("order").all():
712712
if resource.contains_closed_data:
713713
return resource.pk
714714

@@ -735,7 +735,7 @@ def first_information_request_id(self):
735735
@property
736736
def table_last_updated_at(self):
737737
updates = [
738-
u.last_updated_at for u in self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").all()
738+
u.last_updated_at for u in self.tables.exclude(status__slug="under_review").exclude(slug="dicionario").exclude(slug="dictionary").all()
739739
if u.last_updated_at
740740
] # fmt: skip
741741
return max(updates) if updates else None

0 commit comments

Comments
 (0)