Skip to content

Commit

Permalink
fix color thing
Browse files Browse the repository at this point in the history
  • Loading branch information
catgirlinspace committed Aug 2, 2023
1 parent c2363ff commit d0e7b30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion splatnet_assets/templatetags/mask_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ def mask_id(weapon_object: SubWeapon | SpecialWeapon):

@register.simple_tag(takes_context=True)
def get_color(context, uploader: User):
user = context.get('user')
if uploader.sponsor_tiers[SponsorshipTiers.SPONSOR]:
context['color'] = uploader.favorite_color
elif hasattr(context, 'user') and context['user'].is_authenticated:
elif user and user.is_authenticated:
context['color'] = context['user'].favorite_color
if not context.get('color'):
context['color'] = uploader.battles.latest("played_time").teams.first().color
Expand Down

0 comments on commit d0e7b30

Please sign in to comment.