-
Notifications
You must be signed in to change notification settings - Fork 378
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: return same bibxml for versioned and versionless references #4470
Conversation
Fixes ietf-tools#4384. Refactors bibxml production to remove repeated logic. Abandons the half-implemented idea that returning information from the Submission object might be better than the Document or DocHistory objects.
ietf/doc/utils.py
Outdated
|
||
def bibxml_for_draft(doc, rev=None): | ||
|
||
if rev != None and rev != doc.rev: |
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.
Since the refactor makes this non-obvious, the primary fix is on this line at and rev != doc.rev
# A future data cleanup would allow this to be simplified | ||
best_event = best_events.order_by('-time').last() | ||
log.assertion('doc.rev == best_event.rev') | ||
doc.date = best_event.time.date() |
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.
This will have to be re-fixed when merged to feat/tzaware
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.
Yep - I actually poked the code this replaces over on tzaware a couple hours ago. Oh well.
Codecov Report
@@ Coverage Diff @@
## main #4470 +/- ##
==========================================
- Coverage 88.43% 88.42% -0.02%
==========================================
Files 296 296
Lines 39674 39684 +10
==========================================
+ Hits 35086 35090 +4
- Misses 4588 4594 +6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Looks much better than it did! A couple comments inline.
# A future data cleanup would allow this to be simplified | ||
best_event = best_events.order_by('-time').last() | ||
log.assertion('doc.rev == best_event.rev') | ||
doc.date = best_event.time.date() |
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.
Yep - I actually poked the code this replaces over on tzaware a couple hours ago. Oh well.
Fixes #4384.
Refactors bibxml production to remove repeated logic.
Abandons the half-implemented idea that returning information from the Submission object might be better than the Document or DocHistory objects.