mirror of
https://github.com/fergalmoran/dss.api.git
synced 2026-02-19 06:06:41 +00:00
Logging to user image
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import os
|
||||
|
||||
DEBUG = True
|
||||
|
||||
DEBUG = os.environ.get('IS_DEBUG', False)
|
||||
|
||||
DSS_TEMP_PATH = os.environ.get('DSS_TEMP_PATH', '/tmp/')
|
||||
DSS_LAME_PATH = os.environ.get('DSS_LAME_PATH', '/usr/bin/sox')
|
||||
DSS_WAVE_PATH = os.environ.get('DSS_WAVE_PATH',
|
||||
|
||||
@@ -175,6 +175,7 @@ class UserProfile(BaseModel):
|
||||
def get_sized_avatar_image(self, width, height):
|
||||
try:
|
||||
image = self.get_avatar_image()
|
||||
logger.debug("get_sized_avatar_image: %s".format(image))
|
||||
sized = thumbnail.get_thumbnail(image, "%sx%s" % (width, height), crop="center")
|
||||
return urllib.parse.urljoin(settings.MEDIA_URL, sized.name)
|
||||
except SuspiciousOperation:
|
||||
|
||||
Reference in New Issue
Block a user