Skip to content

Commit 3713b69

Browse files
committed
Add LEGAL_NOTICE.md and require acceptance during onboarding
1 parent 569c88b commit 3713b69

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

linkedin/onboarding.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
import logging
66

7-
from linkedin.conf import ENV_FILE
7+
from linkedin.conf import COOKIES_DIR, ENV_FILE
88

99
logger = logging.getLogger(__name__)
1010

11+
LEGAL_ACCEPTANCE_MARKER = COOKIES_DIR / ".legal_notice_accepted"
12+
1113

1214
def _read_multiline(prompt_msg: str) -> str:
1315
"""Read multi-line input via input() until Ctrl-D (EOF)."""
@@ -217,7 +219,10 @@ def _onboard_account(campaign):
217219

218220

219221
def _require_legal_acceptance() -> None:
220-
"""Require the user to read and accept the legal notice before continuing."""
222+
"""Require the user to read and accept the legal notice (once)."""
223+
if LEGAL_ACCEPTANCE_MARKER.exists():
224+
return
225+
221226
url = "https://github.com/eracle/linkedin/blob/master/LEGAL_NOTICE.md"
222227
print()
223228
print("=" * 60)
@@ -229,6 +234,8 @@ def _require_legal_acceptance() -> None:
229234
while True:
230235
answer = input("Do you accept the Legal Notice? (y/n): ").strip().lower()
231236
if answer == "y":
237+
LEGAL_ACCEPTANCE_MARKER.parent.mkdir(parents=True, exist_ok=True)
238+
LEGAL_ACCEPTANCE_MARKER.touch()
232239
return
233240
if answer == "n":
234241
print()

manage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
logging.getLogger().handlers.clear()
2222
logging.basicConfig(
23-
level=logging.INFO,
23+
level=logging.DEBUG,
2424
format="%(message)s",
2525
)
2626

0 commit comments

Comments
 (0)