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: Show recordings for interims#7197
base: main
Are you sure you want to change the base?
Conversation
List the recordings if the "meeting numnber" starts with "interim" Fixes: ietf-tools#6543
Should the same fix be made for the buttons, at https://github.com/ietf-tools/datatracker/blob/main/ietf/templates/meeting/session_buttons_include.html#L139 ? |
@@ -320,7 +320,7 @@ <h3 class="mt-4">Notes and recordings</h3> | |||
</tr> | |||
{% endif %} | |||
{# Recordings #} | |||
{% if meeting.number|add:"0" >= 80 %} | |||
{% if meeting.number|add:"0" >= 80 or "interim" in meeting.number %} |
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.
{% if meeting.number|add:"0" >= 80 or "interim" in meeting.number %} | |
{% if meeting.type_id == 'ietf' and meeting.number|add:"0" >= 80 or meeting.type_id != 'ietf' %} |
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.
The above suggestion is a bit awkward - it requires knowing the precedence of operators as documented at https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#boolean-operators. It might be better to move this into the view code to get away from the |add:"0"
type-coersion-by-hack-trick anyhow.
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.
I thought of something like that. In addition to the one mentioned above, the other tests against meeting 60. What's the significance of meetings 60 and 80? I'd like to remove the magic numbers, replacing with a reasonable function name.
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.
they aren't magic (though they aren't complete) - they are places where the shape of proceedings and what was captured at meetings fundamentally changes. 60 was when we first started capturing chatlogs (jabber at the time). 80 was a point at where recording tech changed significantly.
That said, we don't have any Documents of type "recording" before ietf-100, so the code being touched here could could (for meetings of type ietf) not show the recordings block at all for meeting numbers < 100.
Improve the test to be more general. Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7197 +/- ##
==========================================
- Coverage 88.98% 88.93% -0.05%
==========================================
Files 291 291
Lines 40717 41063 +346
==========================================
+ Hits 36233 36521 +288
- Misses 4484 4542 +58 ☔ View full report in Codecov by Sentry. |
Looks like it. This really needs a new (or updated) test. |
Put same "records available?" test in the buttons that we did in the interim meeting status page. Fixes: ietf-tools#6543
Add filters to meeting to test if we have recordings and have_notes, rather than inline examination of the meeting instance and tests.
Remove the use_notes parameter from the various templates. Instead, add a new meeting filter, has_notes, and use that in the templates.
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 is shaping up nicely. It should go a litter further as noted inline.
@@ -881,3 +881,19 @@ def badgeify(blob): | |||
) | |||
|
|||
return text | |||
|
|||
@register.filter | |||
def has_chat_logs(meeting): |
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.
Should this get the same "Return true for interims" treatment?
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.
It's not clear that these should be filters - why aren't they methods on Meeting instead? (those would be visible to the templates). I think you were on the way to discovering that with the partial removal of the has_notes filter, and the redundant argument passed to the templates in the views later.
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.
Happy to make them methods on the meeting if you prefer. I didn't know templates could invoke methods directly :)
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.
Should this get the same "Return true for interims" treatment?
I guess? I changed it in the commit 466a630
#register.filter | ||
#define has_notes(meeting): | ||
return meeting.uses_notes() |
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 looks incomplete - if the intent was to remove the filter L899 should also go.
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.
(and I suspect all of these should just be removed once the functionality is moved to Meeting.
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.
yes, this was just checking in a snapshot before i got on the plane. will move to templates and fix shortly.
Also fix has_notes() to be consistent with has_recordings()
This is for consistency with the meeting uses_notes method
List the recordings if the "meeting numnber" starts with "interim"
Fixes: #6543