Skip to content

Add ORCID to requests table#710

Merged
anitamnd merged 4 commits intodevelopfrom
feature/requests-orcid
Feb 24, 2026
Merged

Add ORCID to requests table#710
anitamnd merged 4 commits intodevelopfrom
feature/requests-orcid

Conversation

@anitamnd
Copy link
Collaborator

This PR displays ORCID information of users who request editing rights or ownership of tools to improve verification in the request review process.

@anitamnd anitamnd requested a review from Copilot February 24, 2026 11:38
@anitamnd anitamnd merged commit 8059af6 into develop Feb 24, 2026
3 checks passed
@anitamnd anitamnd deleted the feature/requests-orcid branch February 24, 2026 11:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds ORCID visibility to the “Received requests” table to help reviewers verify the identity of users requesting editing rights or ownership.

Changes:

  • Add an “ORCID” column to the received requests UI.
  • Extend ResourceRequestSerializer to include an orcid field derived from the requesting user’s ORCID social account.
  • Minor whitespace cleanup in the requests partial.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
frontend/partials/requests.html Displays an ORCID column and links to the requester’s ORCID profile in the received-requests table.
backend/elixir/serialization/resource_serialization/resourceRequest.py Adds an orcid field to serialized request payloads by reading from SocialAccount (ORCID provider).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +44 to 45
<td><a href="https://orcid.org/{{entry.orcid}}" target="_blank">{{entry.orcid}}</a></td>
<td>
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The ORCID cell always renders an anchor, so when entry.orcid is empty/undefined the UI shows a blank link pointing to https://orcid.org/. Consider only rendering the link when an ORCID is present (e.g., ng-if="entry.orcid") and show a placeholder (e.g., � or an empty cell) otherwise, consistent with the profile page’s conditional ORCID link rendering.

Suggested change
<td><a href="https://orcid.org/{{entry.orcid}}" target="_blank">{{entry.orcid}}</a></td>
<td>
<td>
<a ng-if="entry.orcid" href="https://orcid.org/{{entry.orcid}}" target="_blank">{{entry.orcid}}</a>
<span ng-if="!entry.orcid"></span>
</td>
<td>

Copilot uses AI. Check for mistakes.
<td>{{ typeDescription(entry.type) }}</td>
<td>{{ entry.username }}</td>
<td>{{ entry.email }}</td>
<td><a href="https://orcid.org/{{entry.orcid}}" target="_blank">{{entry.orcid}}</a></td>
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

Opening a third-party URL in a new tab via target="_blank" should include rel="noopener noreferrer" to prevent the new page from accessing window.opener (reverse-tabnabbing). Please add the rel attribute to this ORCID link.

Suggested change
<td><a href="https://orcid.org/{{entry.orcid}}" target="_blank">{{entry.orcid}}</a></td>
<td><a href="https://orcid.org/{{entry.orcid}}" target="_blank" rel="noopener noreferrer">{{entry.orcid}}</a></td>

Copilot uses AI. Check for mistakes.
Comment on lines +33 to +37
try:
orcid_account = SocialAccount.objects.get(user=obj.user, provider='orcid')
return orcid_account.uid
except SocialAccount.DoesNotExist:
return ''
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

SocialAccount.objects.get(...) can raise MultipleObjectsReturned (e.g., duplicate ORCID connections), which would 500 the request list. Use a safer lookup (e.g., .filter(...).first()), and decide which ORCID to prefer if multiple exist.

Suggested change
try:
orcid_account = SocialAccount.objects.get(user=obj.user, provider='orcid')
return orcid_account.uid
except SocialAccount.DoesNotExist:
return ''
orcid_account = (
SocialAccount.objects.filter(user=obj.user, provider='orcid')
.order_by('id')
.first()
)
if orcid_account is not None:
return orcid_account.uid
return ''

Copilot uses AI. Check for mistakes.
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.

2 participants