Skip to content

Commit c141d50

Browse files
committed
Ensure no duplicate countries in get_countries_with_roles
1 parent c41ebc4 commit c141d50

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tigacrafting/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ def assignments(self) -> models.QuerySet:
418418

419419
@property
420420
def confidence_label(self) -> str:
421+
# TODO: check that API does not fix this as enum. This changes according to language.
421422
return get_confidence_label(value=self.confidence)
422423

423424
@cached_property
@@ -1396,7 +1397,7 @@ def get_countries_with_roles(self) -> List['tigaserver_app.EuropeCountry']:
13961397
countries.append(country)
13971398
if country := self.national_supervisor_of:
13981399
countries.append(country)
1399-
return countries
1400+
return list(set(countries))
14001401

14011402
# NOTE: override UserRolePermissionMixin
14021403
def get_role(self, country: Optional['tigaserver_app.EuropeCountry'] = None) -> Role:

0 commit comments

Comments
 (0)