Fix types

This commit is contained in:
Joakim Hellsén 2026-03-16 18:40:04 +01:00
commit c092d3089f
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
13 changed files with 48 additions and 18 deletions

View file

@ -289,7 +289,7 @@ class KickDropCampaign(auto_prefetch.Model):
"""Return the image URL for the campaign."""
# Image from first drop
if self.rewards.exists(): # pyright: ignore[reportAttributeAccessIssue]
first_reward: KickReward = self.rewards.first() # pyright: ignore[reportAttributeAccessIssue]
first_reward: KickReward | None = self.rewards.first() # pyright: ignore[reportAttributeAccessIssue]
if first_reward and first_reward.image_url:
return first_reward.full_image_url

View file

@ -442,6 +442,8 @@ class ImportKickDropsCommandTest(TestCase):
campaign: KickDropCampaign = KickDropCampaign.objects.get()
assert campaign.name == "PUBG 9th Anniversary"
assert campaign.status == "active"
assert campaign.organization is not None
assert campaign.category is not None
assert campaign.organization.name == "KRAFTON"
assert campaign.category.name == "PUBG: Battlegrounds"