Skip to content

fix(users): Commit user profile data to DB#403

Merged
sakshamarora1 merged 1 commit intoCERNDocumentServer:masterfrom
sakshamarora1:fix/missing_user_profiles
Apr 13, 2026
Merged

fix(users): Commit user profile data to DB#403
sakshamarora1 merged 1 commit intoCERNDocumentServer:masterfrom
sakshamarora1:fix/missing_user_profiles

Conversation

@sakshamarora1
Copy link
Copy Markdown
Contributor

fixes: #402

@sakshamarora1 sakshamarora1 force-pushed the fix/missing_user_profiles branch from 9a4a48b to a6880ff Compare April 13, 2026 08:29
# Validate username, if not valid, generate a new prefixed username from email
if not re.fullmatch(
current_app.config["ACCOUNTS_USERNAME_REGEX"], username
):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

how does it fix the MIGRATED prefix? The goal was not to have it displayed in the visible spots.

part of why it was handled like this is that these accounts are also having duplicated usernames, we should detect when this happens and do some mitigations

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the migrated prefix is fixed by having the full_name being populated in the api.py file

@sakshamarora1 sakshamarora1 force-pushed the fix/missing_user_profiles branch from a6880ff to 65e36d3 Compare April 13, 2026 08:41
remote_account = self.create_invenio_remote_account(user_id, extra_data)
db.session.add(remote_account)

db.session.commit()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This will fix the migrated in the username, since the frontend checks first for the "full_name" in the user_profile and if not found, defaults to the username

@sakshamarora1 sakshamarora1 force-pushed the fix/missing_user_profiles branch from 65e36d3 to a6880ff Compare April 13, 2026 09:40
@sakshamarora1 sakshamarora1 merged commit e1af2c6 into CERNDocumentServer:master Apr 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

users: set profile full name when migrating

2 participants