Skip to content

feat: Show bluesheets using Attended tables#7003

Closed
pselkirk wants to merge 11 commits intoietf-tools:mainfrom
pselkirk:fix-6898-6454
Closed

feat: Show bluesheets using Attended tables#7003
pselkirk wants to merge 11 commits intoietf-tools:mainfrom
pselkirk:fix-6898-6454

Conversation

@pselkirk
Copy link
Copy Markdown
Contributor

@pselkirk pselkirk commented Jan 31, 2024

Fixes #6898
Fixes #6454

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 31, 2024

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (d31605e) 88.91% compared to head (90feb2b) 88.98%.
Report is 38 commits behind head on main.

❗ Current head 90feb2b differs from pull request most recent head 8cddcdf. Consider uploading reports for the commit 8cddcdf to get more accurate results

Files Patch % Lines
ietf/sync/views.py 8.33% 11 Missing ⚠️
ietf/meeting/views.py 98.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7003      +/-   ##
==========================================
+ Coverage   88.91%   88.98%   +0.06%     
==========================================
  Files         289      291       +2     
  Lines       40454    40771     +317     
==========================================
+ Hits        35971    36281     +310     
- Misses       4483     4490       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pselkirk pselkirk marked this pull request as ready for review January 31, 2024 03:44
Copy link
Copy Markdown
Member

@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

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

I think there are a couple of sharp corners that should be fixed - at least putting a check before accepting a self-declared attendance POST is a must-fix.

Comment thread ietf/meeting/migrations/0005_attended_origin_attended_time.py Outdated
Comment thread ietf/meeting/views.py Outdated
Comment thread ietf/meeting/models.py
Comment thread ietf/meeting/utils.py Outdated
Copy link
Copy Markdown
Member

@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

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

One remaining question: what happens if save_bluesheet() returns an error?

I came across it noticing that generate_bluesheet() now returns None on one branch and returns the outcome of save_bluesheet() on the other.

- Rename the live "bluesheet" to "attendance", add some explanatory text.
- Add attendance links in materials view and pre-finalized proceedings view.
- Don't allow users to add themselves after the corrections cutoff date.
@pselkirk pselkirk requested a review from rjsparks February 12, 2024 19:06
Copy link
Copy Markdown
Member

@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

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

My concerns are addressed.

Copy link
Copy Markdown
Member

@rjsparks rjsparks left a comment

Choose a reason for hiding this comment

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

The new attendance view needs slightly tighter gating.

Comment thread ietf/meeting/views.py
meeting = session.meeting
return [{'name':attended.person.name, 'affiliation':affiliation(meeting, attended.person)} for attended in attendance]

def session_attendance(request, session_id, num):
Copy link
Copy Markdown
Member

@rjsparks rjsparks Feb 13, 2024

Choose a reason for hiding this comment

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

This needs to not allow someone to say "I attended" before the session happened. It should probably not let people in at all until at least one Attended record exists for a session. That's counting on a side-effect since the only other way such a record would be created is MeetEcho's upload right now, but we should take advantage of that for now - otherwise we have to define when the view should open based on some calculation of "the session is over".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Using that "side effect" has the nice property that it mostly prevents impatient people from self-attesting their attendance before MeetEcho uploads their records. I.e., I think it's pretty close to the right signal to open this mechanism up.

Comment thread ietf/meeting/views.py Outdated

cor_cut_off_date = session.meeting.get_submission_correction_date()
today_utc = date_today(datetime.timezone.utc)
person = request.user.person
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Guard here against personless users. In particular, guard against AnonymousUser

Comment thread ietf/meeting/views.py Outdated

attendance = Attended.objects.filter(session=session)
meeting = session.meeting
return [{'name':attended.person.name, 'affiliation':affiliation(meeting, attended.person)} for attended in attendance]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should use person.plain_name()

Comment thread ietf/templates/meeting/attendance.html
Comment thread ietf/meeting/views.py
data = bluesheet_data(session)
if not data:
return
text = render_to_string('meeting/bluesheet.txt', {
Copy link
Copy Markdown
Member

@rjsparks rjsparks Feb 13, 2024

Choose a reason for hiding this comment

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

This generates names in a different order than what MeetEcho uploads for bluesheets. There is timing data that MeetEcho has that is not available to us yet, so this may not be avoidable. What MeetEcho uploads for bluesheets is essentially in "joined the session" order. @alexamirante I wonder if join time could be added to the session attendee upload API - we could then use that in the new time field this PR adds to the Attended table.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@rjsparks yes, we can send join times as well if needed.

Comment thread ietf/meeting/views.py
Comment on lines +2555 to +2560
try:
person = request.user.person
was_there = Attended.objects.filter(session=session, person=person).exists()
can_add = today_utc <= cor_cut_off_date and MeetingRegistration.objects.filter(meeting=session.meeting, person=person).exists() and Attended.objects.filter(session=session).exists() and not was_there
except AttributeError:
was_there = can_add = False
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think something like
if user.is_authenticated and user.person is not None:
would be a lot better

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

avoid a=b=c constructs. These are hard for new contributors to deal with.

@rjsparks
Copy link
Copy Markdown
Member

This became feat/sess-apis

@rjsparks rjsparks closed this Feb 26, 2024
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

4 participants