Cleanup country_shortname, use country.shortname instead

This commit is contained in:
Raffson 2023-05-21 14:13:33 +02:00
parent f9e15951f2
commit 72eb6622ac
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 1 additions and 6 deletions

View File

@ -47,9 +47,6 @@ class Faction:
# Country used by this faction # Country used by this faction
country: Country country: Country
# Country's short name used by this faction
country_shortname: str = field(default="")
# Nice name of the faction # Nice name of the faction
name: str = field(default="") name: str = field(default="")
@ -194,8 +191,6 @@ class Faction:
faction = Faction(locales=json.get("locales"), country=country) faction = Faction(locales=json.get("locales"), country=country)
faction.country_shortname = country.shortname
faction.name = json.get("name", "") faction.name = json.get("name", "")
if not faction.name: if not faction.name:
raise AssertionError("Faction has no valid name") raise AssertionError("Faction has no valid name")

View File

@ -144,7 +144,7 @@ class SquadronLiverySelector(QComboBox):
selected_livery = squadron.livery selected_livery = squadron.livery
liveries = set() liveries = set()
cc = squadron.coalition.faction.country_shortname cc = squadron.coalition.faction.country.shortname
aircraft_liveries = set(self.aircraft_type.dcs_unit_type.iter_liveries()) aircraft_liveries = set(self.aircraft_type.dcs_unit_type.iter_liveries())
if len(aircraft_liveries) == 0: if len(aircraft_liveries) == 0:
logging.info(f"Liveries for {self.aircraft_type} is empty!") logging.info(f"Liveries for {self.aircraft_type} is empty!")