Skip to content

Commit

Permalink
Merge pull request #27 from uw-it-aca/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jlaney authored Dec 8, 2020
2 parents 95bf294 + ba9fc0f commit 7cd18de
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions analytics/report_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

RETRY_STATUS_CODES = [0, 408, 500, 502, 503, 504]
RETRY_MAX = 5
RETRY_DELAY = 3
RETRY_DELAY = 5


class ReportBuilder():
Expand Down Expand Up @@ -86,12 +86,18 @@ def build_subaccount_activity_report(self, root_account_id, sis_term_id):

setattr(activity, key, val)

data = self.get_activity_by_account(sis_account_id, sis_term_id)
try:
data = self.get_activity_by_account(sis_account_id,
sis_term_id)

for item in data["by_category"]:
setattr(activity,
"{}_views".format(item["category"]),
item["views"])

for item in data["by_category"]:
setattr(activity,
"{}_views".format(item["category"]),
item["views"])
except DataFailureException as ex:
if ex.status != 504:
raise

activity.save()

Expand Down

0 comments on commit 7cd18de

Please sign in to comment.