Skip to content

Commit

Permalink
Change check for parent_dataset in count_posts.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sal-uva committed Feb 24, 2022
1 parent 7b4bdcd commit 9ebcc26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion processors/metrics/count_posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ def get_options(cls, parent_dataset=None, user=None):
options = cls.options

# We give an option to add relative trends for local datasources
if parent_dataset and parent_dataset.parameters.get("datasource") in ("4chan", "8kun", "8chan", "parliaments", "usenet", "breitbart"):
if not parent_dataset:
return options

if parent_dataset.parameters.get("datasource") in ("4chan", "8kun", "8chan", "parliaments", "usenet", "breitbart"):
options["add_relative"] = {
"type": UserInput.OPTION_TOGGLE,
"default": False,
Expand Down

0 comments on commit 9ebcc26

Please sign in to comment.