Skip to content

Commit

Permalink
cat
Browse files Browse the repository at this point in the history
  • Loading branch information
catgirlinspace committed Jul 29, 2023
1 parent ebd1d0e commit 4084d79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions splatnet_assets/templatetags/mask_id.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django import template
from django.utils.crypto import get_random_string

from splatnet_assets.fields import Color
from splatnet_assets.models import SubWeapon, SpecialWeapon
from users.models import User, SponsorshipTiers

Expand All @@ -20,6 +19,6 @@ def get_color(context, uploader: User):
context['color'] = uploader.favorite_color
elif hasattr(context, 'user') and context['user'].is_authenticated:
context['color'] = context['user'].favorite_color
else:
context['color'] = Color.from_hex("000000ff")
if not context.get('color'):
context['color'] = uploader.battles.latest("played_time").teams.first().color
return ''
4 changes: 1 addition & 3 deletions users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from battles.models import Battle
from splatnet_assets.common_model_choices import XBattleDivisions
from splatnet_assets.fields import ColorField, Color
from splatnet_assets.fields import ColorField

# Create your models here.

Expand Down Expand Up @@ -77,8 +77,6 @@ class User(AbstractUser):
def favorite_color(self):
if self.sponsor_tiers[SponsorshipTiers.SPONSOR] is True:
return self.saved_favorite_color
else:
return Color.from_hex("000000ff")

@property
def display_sponsor_badge(self):
Expand Down

0 comments on commit 4084d79

Please sign in to comment.