Skip to content

Release 0.66.11#3325

Closed
odlbot wants to merge 10 commits into
releasefrom
release-candidate
Closed

Release 0.66.11#3325
odlbot wants to merge 10 commits into
releasefrom
release-candidate

Conversation

@odlbot
Copy link
Copy Markdown
Contributor

@odlbot odlbot commented May 11, 2026

Anastasia Beglova

Ahtesham Quraish

Zaman Afzal

Carey P Gumaer

Matt Bertrand

zamanafzal and others added 10 commits May 8, 2026 11:16
* fix: update metadata for video pages


---------

Co-authored-by: Ahtesham Quraish <ahtesham.quraish@192.168.1.22>
* revised desktop styles

* language select margin

* mobile styles

* fix border radius on mobile

* don't display program controls container if it shouldn't be there

* proper box shadow for new contract header

* fix mobile gap between header title and subtitle

* fix program header font size
* feat: add course content outline section on course pages
… video collection page (#3316)

* fix: change the video detail page route


---------

Co-authored-by: Ahtesham Quraish <ahtesham.quraish@A006-01455.local>
@github-actions
Copy link
Copy Markdown

OpenAPI Changes

No changes detected

View full changelog

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

Comment thread authentication/api.py
Comment on lines +36 to +46
user, created = User.objects.get_or_create(email=email, defaults=defaults)

profile_api.ensure_profile(user, profile_data=profile_data)
if created:
transaction.on_commit(
lambda: user_created_actions(
user=user,
is_new=True,
details=profile_data or {},
)
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The create_user function calls ensure_profile twice for new users: once directly and again via an on_commit hook, causing a redundant database write.
Severity: LOW

Suggested Fix

Remove the direct, synchronous call to profile_api.ensure_profile(user, profile_data=profile_data) from the create_user function. The profile creation should be handled exclusively by the on_commit hook (user_created_actions) to ensure it is only called once after the user is successfully saved to the database.

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: authentication/api.py#L36-L46

Potential issue: When a new user is created via the `create_user` function, the
`ensure_profile` function is invoked twice. The first call happens synchronously within
the function body. The second call is triggered asynchronously after the database
transaction commits, via an `on_commit` hook that executes `user_created_actions`. While
the `ensure_profile` function is idempotent due to its use of `update_or_create`, this
redundant call results in an unnecessary database write operation (a create followed by
an update) for every new user. This is a logic error that introduces inefficiency.

Also affects:

  • profiles/plugins.py:12~21
  • profiles/api.py:13~22

Did we get this right? 👍 / 👎 to inform future reviews.

@abeglova abeglova closed this May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants