Skip to content

Commit

Permalink
additional_checks: Group by type
Browse files Browse the repository at this point in the history
  • Loading branch information
jarofgreen committed Nov 3, 2022
1 parent f4016a8 commit 5c0d9ce
Show file tree
Hide file tree
Showing 3 changed files with 672 additions and 381 deletions.
5 changes: 5 additions & 0 deletions cove_ofds/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from libcoveweb2.models import SuppliedDataFile
from libcoveweb2.process import ProcessDataTask
from libcoveweb2.utils import group_data_list_by


class WasJSONUploaded(ProcessDataTask):
Expand Down Expand Up @@ -317,5 +318,9 @@ def get_context(self):
with open(self.checks_and_stats_filename) as fp:
context.update(json.load(fp))
context["additional_checks_count"] = len(context["additional_checks"])
context["additional_checks"] = group_data_list_by(
context["additional_checks"], lambda i: i["type"]
)
print(context["additional_checks"])
# done!
return context
Loading

0 comments on commit 5c0d9ce

Please sign in to comment.