()
| 37 | |
| 38 | |
| 39 | def teacher_session() -> Optional[_Session]: |
| 40 | global _teacher_session |
| 41 | |
| 42 | if not _teacher_session: |
| 43 | if "teacher_auth" not in get_auth(): |
| 44 | warnings.warn(f"Could not test for teacher session") |
| 45 | return None |
| 46 | |
| 47 | data = get_auth()["teacher_auth"] |
| 48 | _teacher_session = login(data["username"], data["password"]) |
| 49 | |
| 50 | return _teacher_session |
| 51 | |
| 52 | |
| 53 | def allow_before(d: datetime) -> bool: |