Merged in [19177] from rjsparks@nostrum.com:

Additional tweak to oidc profile photo url generation.
 - Legacy-Id: 19179
Note: SVN reference [19177] has been migrated to Git commit a3305e1bd5
This commit is contained in:
Robert Sparks 2021-07-01 17:15:30 +00:00
commit 74eb7c1e28

View file

@ -250,7 +250,9 @@ class Person(models.Model):
source_url = self.photo.url
if source_url.startswith(settings.IETF_HOST_URL):
source_url = source_url[len(settings.IETF_HOST_URL):]
return f'{settings.IETF_HOST_URL}cdn-cgi/image/fit=scale-down,width={size},height={size}{source_url}'
elif source_url.startswith('/'):
source_url = source_url[1:]
return f'{settings.IETF_HOST_URL}cdn-cgi/image/fit=scale-down,width={size},height={size}/{source_url}'
else:
datatracker_photo_path = urlreverse('ietf.person.views.photo', kwargs={'email_or_name': self.email()})
datatracker_photo_url = settings.IDTRACKER_BASE_URL + datatracker_photo_path