Skip to content

Commit

Permalink
better way of detecting splashcat.social accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
catgirlinspace committed Jul 16, 2023
1 parent 09958fb commit d9e4cc2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from django.urls import reverse
from django.utils.crypto import get_random_string
from django.utils.translation import gettext_lazy as _
from oidc_provider.models import UserConsent
from oidc_provider.models import Token

from battles.models import Battle
from splatnet_assets.common_model_choices import XBattleDivisions
Expand Down Expand Up @@ -101,7 +101,7 @@ def get_absolute_url(self):

@property
def has_mastodon_account(self):
return UserConsent.objects.filter(user=self, client_id=1).exists()
return Token.objects.filter(user=self, client_id=1).exists()

@property
def is_verified_for_export_download(self):
Expand Down Expand Up @@ -132,6 +132,9 @@ def send_verification_email(self):
})
self.email_user('Verify your email address', message_contents)

def get_groups(self):
return self.groups_owned.all() | self.group_set.all()


def generate_key():
return get_random_string(20)
Expand Down

0 comments on commit d9e4cc2

Please sign in to comment.