Skip to content

Commit

Permalink
Merge pull request #421 from SpongePowered/feature/custom-letter-avatars
Browse files Browse the repository at this point in the history
Customizable letter avatar url
  • Loading branch information
lukegb authored Dec 15, 2019
2 parents f9fc2b3 + 992d646 commit b55df3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions spongeauth/accounts/letter_avatar.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import hashlib

LETTER_AVATAR_BASE = "https://forums-cdn.spongepowered.org/" "letter_avatar_proxy/v2/letter/{}/{}/240.png"
from django.conf import settings


class LetterAvatar(object):
Expand All @@ -19,7 +18,7 @@ def colour(self):
return "".join(hex(c)[2:].rjust(2, "0") for c in colour)

def get_absolute_url(self):
return LETTER_AVATAR_BASE.format(self.username[0].lower(), self.colour)
return settings.LETTER_AVATAR_BASE.format(self.username[0].lower(), self.colour)


# palette of optimally disctinct colors
Expand Down
2 changes: 2 additions & 0 deletions spongeauth/spongeauth/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,5 @@

# Redis queue settings.
RQ_QUEUES = {"default": {"HOST": "localhost", "PORT": 6379, "DB": 0, "DEFAULT_TIMEOUT": 300}}

LETTER_AVATAR_BASE = "https://forums-cdn.spongepowered.org/" "letter_avatar_proxy/v2/letter/{}/{}/240.png"

0 comments on commit b55df3f

Please sign in to comment.