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 select for update #906
Conversation
Pull Request Test Coverage Report for Build 1522
💛 - Coveralls |
@dag18e I understand your point but your change is gonna drop the lock on the database row and it's completely changing the intended behaviour |
@dag18e 🤦 I was reviewing this on my mobile and I didn't notice how it really was. Ignore my first comment. Also, an entry into the CHANGELOG is required |
@MattBlack85 Hey man, sorry about the delay here. Had some other stuff come up + holidays so I'm just getting back to this. On your note about filter vs get, I changed it a bit to use filter. Basically, I wrap it in a list and grab the first in the list. This ought to retain the original functionality, but it also doesn't apply a limit to the request so it works with Oracle 12c. I'll be adding info to docs and changelog once tests pass Travis. |
Codecov Report
@@ Coverage Diff @@
## master #906 +/- ##
=======================================
Coverage 95.04% 95.04%
=======================================
Files 25 25
Lines 1070 1070
=======================================
Hits 1017 1017
Misses 53 53 Continue to review full report at Codecov.
|
@MattBlack85 Actually, do you think I need to add anything to the documentation? I don't really feel this change is worthy of a change there, but you'd know better than me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MattBlack85 I think this is good with the change to using a transaction.
Thanks @dag18e
token = refresh_token_model.objects.select_for_update().filter( | ||
pk=self.pk, revoked__isnull=True | ||
) | ||
except refresh_token_model.DoesNotExist: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #866
Description of the Change
Oracle Database 12c does not allow limits on
select_for_update
statements. This change removes the limit and instead just uses aget
.Checklist
CHANGELOG.md
updated (only for user relevant changes)AUTHORS