Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check if user has attributes before accessing attributes #3759

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

shreddedbacon
Copy link
Member

@shreddedbacon shreddedbacon commented Jul 2, 2024

General Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for inclusion in changelog

Database Migrations

  • If your PR contains a database migation, it MUST be the latest in date order alphabetically

#3675 introduced last_accessed attribute to users. Most users get an attribute added to them when they are created, but users created via an IDP do not. This is just a quick fix to check that attributes exist before trying to access the attribute value.

Also moves the lastaccessed call to apollo so it is only called once on the initial request, rather than every haspermission check

@shreddedbacon shreddedbacon added this to the 2.20.0 milestone Jul 2, 2024
@shreddedbacon shreddedbacon marked this pull request as ready for review July 2, 2024 01:01
@shreddedbacon shreddedbacon marked this pull request as draft July 2, 2024 01:04
@shreddedbacon shreddedbacon marked this pull request as ready for review July 2, 2024 01:06
Copy link
Member

@tobybellwood tobybellwood left a comment

Choose a reason for hiding this comment

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

LGTM

@tobybellwood tobybellwood merged commit 42967be into main Jul 3, 2024
1 check passed
@tobybellwood tobybellwood deleted the fix-last-accessed-check branch July 4, 2024 22:14
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