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

[#2494] Switch to DB queries to get allow_edit_projects #2495

Merged
merged 1 commit into from Jan 19, 2017

Conversation

punchagan
Copy link
Contributor

@punchagan punchagan commented Dec 28, 2016

To get the list of projects where a user has change permissions, use DB
queries instead of a loop wrapping DB queries to make the response much faster.
This fixes timeouts for users who are not rsr admins but have change
permissions for a lot of projects.

Closes #2494

  • Test plan | Unit test | Integration test
  • Copyright header
  • Code formatting
  • Documentation
  • Change log entry

Partnership.objects.create(project=project, organisation=org)
self.c = Client(HTTP_HOST=settings.RSR_DOMAIN)

def tearDown(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: should the Groups be deleted here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

check_auth_groups actually checks if groups exist before trying to create them. So, it doesn't really matter, but I guess for consistency, it's better to delete them. I'll push a fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

To get the list of projects where a user has `change` permissions, use DB
queries instead of a loop wrapping DB queries to make the response much faster.
This fixes timeouts for users who are not rsr admins but have change
permissions for a lot of projects.

Closes #2494
@punchagan punchagan force-pushed the #2494-fix-api-key-permissions branch from 341ac13 to 40849ed Compare January 4, 2017 06:30
@zzgvh zzgvh merged commit 3df4242 into develop Jan 19, 2017
@zzgvh zzgvh deleted the #2494-fix-api-key-permissions branch January 19, 2017 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Signing in from RSR Up fails with error 'Unable to authorize:'
2 participants