Skip to content

Commit 61f0172

Browse files
committed
Added some code to set the meeting attendance flag when Meetecho pulls OAuth2 profile data for session participation between the start and end dates for a meeting.
- Legacy-Id: 17956
1 parent efcdc4d commit 61f0172

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

ietf/ietfauth/utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
# various authentication and authorization utilities
66

7+
import datetime
8+
79
import oidc_provider.lib.claims
10+
from oidc_provider.models import Client as ClientRecord
11+
812

913
from functools import wraps
1014

@@ -238,8 +242,16 @@ def scope_registration(self):
238242
meeting = get_current_ietf_meeting()
239243
person = self.user.person
240244
reg = MeetingRegistration.objects.filter(person=person, meeting=meeting).first()
245+
today = datetime.date.today()
241246
info = {}
242247
if reg:
248+
# maybe register attendence if logged in to follow a meeting
249+
if meeting.date <= today <= meeting.end_date():
250+
client = ClientRecord.objects.get(client_id=self.client.client_id)
251+
if client.name == 'Meetecho' and not reg.attended:
252+
reg.attended = True
253+
reg.save()
254+
# fill in info to return
243255
info = {
244256
'meeting': reg.meeting.number,
245257
# full_week, one_day, student:

0 commit comments

Comments
 (0)