Skip to content

Commit

Permalink
Fix the broken resource gallery submission validation (#376)
Browse files Browse the repository at this point in the history
* Move IssueInfo.data initialization from __post_init_post_parse__ to _get_input_()

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
erogluorhan and pre-commit-ci[bot] authored Dec 22, 2023
1 parent 161e691 commit 1cf502a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/collect-user-submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ class IssueInfo:
gh_event_path: pydantic.FilePath
submission: Submission = pydantic.Field(default=None)

def __post_init_post_parse__(self):
with open(self.gh_event_path) as f:
self.data = json.load(f)

def create_submission(self):
self._get_inputs()
self._create_submission_input()
return self

def _get_inputs(self):
with open(self.gh_event_path) as f:
self.data = json.load(f)

self.author = self.data['issue']['user']['login']
self.title = self.data['issue']['title']
self.body = self.data['issue']['body']
Expand Down
6 changes: 3 additions & 3 deletions portal/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ the example data used by the [Pythia Foundations Book](https://foundations.proje

## Join us!

If you have questions or want to share anything with the Project
Pythia Team, please reach out to us through the [Project Pythia
category on the Pangeo Discourse forum](https://discourse.pangeo.io/c/education/project-pythia/)
If you have questions or want to share anything with the Project
Pythia Team, please reach out to us through the [Project Pythia
category on the Pangeo Discourse forum](https://discourse.pangeo.io/c/education/project-pythia/)
below or join us at our [Weekly Working Group Meetings](#weekly-working-group-meetings).

<span class="d-flex justify-content-center pt-1 pb-4">
Expand Down

0 comments on commit 1cf502a

Please sign in to comment.