Skip to content

Partner logo URL is not returning correcly #49

@dcoa

Description

@dcoa

there is an issue resulting of the environment configuration I guess.

This plugin has the following function that return the logo from an organization

def get_logo(self, obj):
"""Return the URL of the corporate partner organization's logo."""
try:
if obj.organization and obj.organization.logo:
return f"{settings.LMS_ROOT_URL}{obj.organization.logo.url}"
except (ValueError, AttributeError):
pass
return None

The function append the LMS_ROOT_URL what is okay to resolve the URL in local environment but cause a double domain in production (stage instance) where the url is associated to a S3 bucket.

Production URL : "https://tandjungpriok.edunext.cloudhttps://openedx-tandjungpriok-uploads.s3.amazonaws.com/organization_logos/edunext_logo.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA5BPTYXZG3SC6F3O6%2F20260127%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260127T071529Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=d22be16e226969ed8db485804366516e5362e6be8a80a5c5d3213198e2bbc533"

I think the solution is just return

return obj.organization.logo.url

however, that will cause the error in development because the returning is a relative path, that can not resolve.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions