Release 0.66.11#3315
Closed
odlbot wants to merge 2 commits into
Closed
Conversation
* feat: Welcome to learn email
OpenAPI ChangesNo changes detected Unexpected changes? Ensure your branch is up-to-date with |
| > | ||
| <a | ||
| class="button-a button-a-primary" | ||
| href="{{ APP_BASE_URL }}/dashboard" |
There was a problem hiding this comment.
Bug: The dashboard URL in the welcome email is built by concatenating {{ APP_BASE_URL }} and /dashboard, which can create a double-slash if APP_BASE_URL has a trailing slash.
Severity: MEDIUM
Suggested Fix
Use the urljoin filter from Django's future template tags to correctly join the URL parts. Alternatively, strip the trailing slash from APP_BASE_URL before it is passed to the template context in profiles/utils.py, for example by using settings.APP_BASE_URL.rstrip('/').
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: main/templates/email/welcome_email.html#L77
Potential issue: The welcome email template at `main/templates/email/welcome_email.html`
constructs the dashboard URL as `{{ APP_BASE_URL }}/dashboard`. When the `APP_BASE_URL`
setting is configured with a trailing slash (e.g., `https://learn.mit.edu/`), this
results in a URL with a double slash, like `https://learn.mit.edu//dashboard`. While
many web servers tolerate this, stricter server configurations might interpret this as a
malformed path, leading to a 404 error or an incorrect redirect. This could break the
primary call-to-action link for all new users receiving the welcome email. Other parts
of the codebase handle this by stripping the trailing slash, but this template omits
that step.
Did we get this right? 👍 / 👎 to inform future reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Zaman Afzal