Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
d7d7327d
Commit
d7d7327d
authored
Dec 19, 2013
by
Chris Rossi
Committed by
Diana Huang
Jan 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow force checking, disregarding LinkedIn's rules.
parent
dffa8c66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
lms/djangoapps/linkedin/management/commands/findusers.py
+15
-5
No files found.
lms/djangoapps/linkedin/management/commands/findusers.py
View file @
d7d7327d
...
...
@@ -34,7 +34,6 @@ def get_call_limits():
Use 80 emails per API call and 1 call per second.
"""
return
-
1
,
80
,
1
now
=
timezone
.
now
()
.
astimezone
(
pytz
.
timezone
(
'US/Pacific'
))
lastfriday
=
now
while
lastfriday
.
weekday
()
!=
FRIDAY
:
...
...
@@ -63,7 +62,14 @@ class Command(BaseCommand):
dest
=
'recheck'
,
default
=
False
,
help
=
'Check users that have been checked in the past to see if '
'they have joined or left LinkedIn since the last check'
),)
'they have joined or left LinkedIn since the last check'
),
make_option
(
'--force'
,
action
=
'store_true'
,
dest
=
'force'
,
default
=
False
,
help
=
'Disregard the parameters provided by LinkedIn about when it '
'is appropriate to make API calls.'
))
def
handle
(
self
,
*
args
,
**
options
):
"""
...
...
@@ -71,9 +77,13 @@ class Command(BaseCommand):
"""
api
=
LinkedinAPI
()
recheck
=
options
.
pop
(
'recheck'
,
False
)
max_checks
,
checks_per_call
,
time_between_calls
=
get_call_limits
()
if
not
max_checks
:
raise
CommandError
(
"No checks allowed during this time."
)
force
=
options
.
pop
(
'force'
,
False
)
if
force
:
max_checks
,
checks_per_call
,
time_between_calls
=
-
1
,
80
,
1
else
:
max_checks
,
checks_per_call
,
time_between_calls
=
get_call_limits
()
if
not
max_checks
:
raise
CommandError
(
"No checks allowed during this time."
)
def
batch_users
():
"Generator to lazily generate batches of users to query."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment