From 5ee55a19afe5fc7d53e61dabe9aa697529811219 Mon Sep 17 00:00:00 2001 From: Peter Howell Date: Thu, 13 Nov 2025 19:14:53 +0000 Subject: [PATCH] ipaddr --- pipelines.py | 2 +- users.py | 46 +++++++++++++++++++++++----------------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pipelines.py b/pipelines.py index 2221751..10847d6 100644 --- a/pipelines.py +++ b/pipelines.py @@ -216,7 +216,7 @@ async def canvas_data_2024(): #connection_string: str = "postgresql://postgres:rolley34@192.168.1.6/db" # todo: use secrets - connection_string: str = "postgresql://postgres:rolley34@192.168.1.199/db" + connection_string: str = "postgresql://postgres:rolley34@192.168.1.198/db" desired_tables = "users,courses,communication_channels,context_modules,conversation_message_participants,conversation_messages,conversation_participants,conversations,course_sections,enrollment_states,enrollment_dates_overrides,enrollment_terms,enrollments,learning_outcome_groups,learning_outcome_question_results,learning_outcomes,pseudonyms,quizzes,scores,submissions,submission_versions,wiki_pages,wikis".split(',') credentials = Credentials.create(client_id=client_id, client_secret=client_secret) diff --git a/users.py b/users.py index 80d7b46..752d057 100644 --- a/users.py +++ b/users.py @@ -2129,6 +2129,7 @@ def training_find_goos(): pass print() +# Cross-reference training records with upcoming sections to flag missing GOTT work. def cross_ref_training(): from semesters import find_term from openpyxl import Workbook, load_workbook @@ -2265,8 +2266,7 @@ def cross_ref_training(): for t in teachers_bydept[D]: if t == 'STAFF, STAFF': continue - completed = 0 - waived = 0 + waived = False sects = teachers[t] print(f"Sections for {t}: {sects}") goo = sects[0][6] @@ -2274,44 +2274,44 @@ def cross_ref_training(): print(t) sheet.cell(row=r, column=1).value = f"{t}" sheet.cell(row=r, column=2).value = f"{goo}" + teacher_row = r r += 1 - if goo in records['GOTT1']: + has_gott1 = goo in records['GOTT1'] + has_gott2 = goo in records['GOTT2'] + if has_gott1: sheet.cell(row=r, column=2).value = f"✓ GOTT 1 Trained" print(f" GOTT 1") - completed =1 r += 1 if goo in records['Other Certifications']: sheet.cell(row=r, column=2).value = f"✓ GOTT Waived - Outside Training" print(f" GOTT outside training") - completed = 1 - waived = 1 + waived = True r += 1 - if goo in records['GOTT2']: + if has_gott2: sheet.cell(row=r, column=2).value = f"✓ GOTT 2 Trained" print(f" GOTT 2") - completed = 1 - waived = 1 r += 1 if goo in records['POCR Reviewed']: sheet.cell(row=r, column=2).value = f"✓ POCR Reviewed" print(f" POCR") - completed = 1 - waived = 1 + waived = True r += 1 if goo in records['TITLE V GOTT ACADEMY']: sheet.cell(row=r, column=2).value = f"✓ TITLE V GOTT ACADEMY 2014" print(f" GOTT Academy") - completed = 1 - waived = 1 - r += 1 - if not completed: - if waived: - sheet.cell(row=r, column=2).value = f"✓ GOTT 1 Waived" - else: - sheet.cell(row=r, column=2).value = f"- MISSING GOTT 1" - sheet.cell(row=r-1,column=1).fill = flagfont - report.write(f"\tMISSING GOTT 1: {t} {goo}\n") + waived = True r += 1 + missing_requirements = [] + if (not has_gott1) and (not waived): + missing_requirements.append("GOTT 1") + if (not has_gott2) and (not waived): + missing_requirements.append("GOTT 2") + if missing_requirements: + sheet.cell(row=teacher_row, column=1).fill = flagfont + for requirement in missing_requirements: + sheet.cell(row=r, column=2).value = f"- MISSING {requirement}" + report.write(f"\tMISSING {requirement}: {t} {goo}\n") + r += 1 if goo in records['GOTT4']: sheet.cell(row=r, column=2).value = f"✓ GOTT 4 Trained" print(f" GOTT 4") @@ -2345,9 +2345,9 @@ def cross_ref_training(): sheet.cell(row=r, column=3).value = f"{s[1]}" r += 1 - if (not completed) and (not waived): + if missing_requirements: report.write(f"\t\t{s[3]}\t{s[1]}\t{s[7]}\n") - if (not completed) and (not waived): + if missing_requirements: report.write(f"\n") #for c in sheet.columns: