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

fix: Use session.order_in_meeting() in the agenda #5222

Merged

Conversation

jennifer-richards
Copy link
Member

Updates the preprocess_assignments_for_agenda() helper method to use order_in_meeting() to assign session.order_number. This is more stable and agrees with what the session_details() meeting view and the group.views.meetings() view do.

FYI, for the preliminary IETF-116 agenda, the following sessions change number. The data being diffed are [group acronym, session name, order_number] from the JSON data used to construct the agenda display. < are "before" and > are after. Most changes are to breaks/etc that do not have meetecho sessions anyway.

13,14c13,14
< "[\"secretariat\",\"Continental Breakfast\",1]"
< "[\"secretariat\",\"IETF Registration\",2]"
---
> "[\"secretariat\",\"Continental Breakfast\",2]"
> "[\"secretariat\",\"IETF Registration\",3]"
23c23
< "[\"secretariat\",\"Break\",2]"
---
> "[\"secretariat\",\"Break\",4]"
32c32
< "[\"secretariat\",\"Beverage and Snack Break\",3]"
---
> "[\"secretariat\",\"Beverage and Snack Break\",5]"
41c41
< "[\"secretariat\",\"Beverage Break\",4]"
---
> "[\"secretariat\",\"Beverage Break\",6]"
49,51c49,51
< "[\"secretariat\",\"New Participants Dinner\",1]"
< "[\"secretariat\",\"Continental Breakfast\",5]"
< "[\"secretariat\",\"IETF Registration\",3]"
---
> "[\"secretariat\",\"New Participants Dinner\",7]"
> "[\"secretariat\",\"Continental Breakfast\",8]"
> "[\"secretariat\",\"IETF Registration\",9]"
60c60
< "[\"secretariat\",\"Break\",6]"
---
> "[\"secretariat\",\"Break\",10]"
69c69
< "[\"secretariat\",\"Beverage and Snack Break\",7]"
---
> "[\"secretariat\",\"Beverage and Snack Break\",11]"
78c78
< "[\"secretariat\",\"Beverage Break\",8]"
---
> "[\"secretariat\",\"Beverage Break\",12]"
87,88c87,88
< "[\"secretariat\",\"Continental Breakfast\",9]"
< "[\"secretariat\",\"IETF Registration\",4]"
---
> "[\"secretariat\",\"Continental Breakfast\",13]"
> "[\"secretariat\",\"IETF Registration\",14]"
97c97
< "[\"secretariat\",\"Break\",10]"
---
> "[\"secretariat\",\"Break\",15]"
107c107
< "[\"secretariat\",\"Beverage Break\",11]"
---
> "[\"secretariat\",\"Beverage Break\",16]"
116,119c116,119
< "[\"secretariat\",\"Beverage and Snack Break\",12]"
< "[\"ietf\",\"IETF Plenary\",1]"
< "[\"secretariat\",\"Continental Breakfast\",13]"
< "[\"secretariat\",\"IETF Registration\",5]"
---
> "[\"secretariat\",\"Beverage and Snack Break\",17]"
> "[\"ietf\",\"IETF Plenary\",2]"
> "[\"secretariat\",\"Continental Breakfast\",18]"
> "[\"secretariat\",\"IETF Registration\",19]"
128,129c128,129
< "[\"secretariat\",\"Break\",14]"
< "[\"ietf\",\"Host Speaker Series: Quantum Internet\",2]"
---
> "[\"secretariat\",\"Break\",20]"
> "[\"ietf\",\"Host Speaker Series: Quantum Internet\",3]"
138c138
< "[\"secretariat\",\"Beverage Break\",15]"
---
> "[\"secretariat\",\"Beverage Break\",21]"
147c147
< "[\"secretariat\",\"Beverage and Snack Break\",16]"
---
> "[\"secretariat\",\"Beverage and Snack Break\",22]"
156,158c156,158
< "[\"ietf\",\"IETF 116 Social Event at Osanbashi Pier - Hosted by WIDE\",3]"
< "[\"secretariat\",\"Continental Breakfast\",17]"
< "[\"secretariat\",\"IETF Registration\",6]"
---
> "[\"ietf\",\"IETF 116 Social Event at Osanbashi Pier - Hosted by WIDE\",4]"
> "[\"secretariat\",\"Continental Breakfast\",23]"
> "[\"secretariat\",\"IETF Registration\",24]"
167c167
< "[\"secretariat\",\"Beverage and Snack Break\",18]"
---
> "[\"secretariat\",\"Beverage and Snack Break\",25]"

@codecov
Copy link

codecov bot commented Feb 27, 2023

Codecov Report

Merging #5222 (b775379) into main (0ec1264) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #5222   +/-   ##
=======================================
  Coverage   88.58%   88.59%           
=======================================
  Files         295      295           
  Lines       40114    40112    -2     
=======================================
+ Hits        35534    35536    +2     
+ Misses       4580     4576    -4     
Impacted Files Coverage Δ
ietf/group/views.py 90.95% <100.00%> (+0.09%) ⬆️
ietf/meeting/helpers.py 89.84% <100.00%> (-0.07%) ⬇️
ietf/utils/text.py 85.36% <0.00%> (-1.83%) ⬇️
ietf/doc/views_search.py 89.46% <0.00%> (+0.20%) ⬆️
ietf/utils/draft.py 72.26% <0.00%> (+0.51%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@@ -124,7 +124,7 @@ def preprocess_assignments_for_agenda(assignments_queryset, meeting, extra_prefe
# check before blindly assigning to meeting just in case.
if a.session.meeting.pk == meeting.pk:
a.session.meeting = meeting
a.session.order_number = None
a.session.order_number = a.session.order_in_meeting() if a.session.group else None
Copy link
Member

Choose a reason for hiding this comment

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

I know this was preserving existing conditionals, but I wonder if it's possible for session group to be falsy with the current code?

Copy link
Member Author

Choose a reason for hiding this comment

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

It shouldn't be possible - the relation from Session to Group is group = ForeignKey(Group), which does not allow nulls.

Copy link
Member Author

Choose a reason for hiding this comment

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

(And, to be sure:

>>> Session.objects.filter(group__isnull=True).count()
0

@rjsparks rjsparks merged commit a2bdd31 into ietf-tools:main Feb 27, 2023
@jennifer-richards jennifer-richards deleted the jennifer/consistent-ordering branch February 27, 2023 18:32
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants