@@ -28,15 +28,16 @@ class IssueInfo:
2828 gh_event_path : pydantic .FilePath
2929 submission : Submission = pydantic .Field (default = None )
3030
31+ def __post_init_post_parse__ (self ):
32+ with open (self .gh_event_path ) as f :
33+ self .data = json .load (f )
34+
3135 def create_submission (self ):
3236 self ._get_inputs ()
3337 self ._create_submission_input ()
3438 return self
3539
3640 def _get_inputs (self ):
37- with open (self .gh_event_path ) as f :
38- self .data = json .load (f )
39-
4041 self .author = self .data ['issue' ]['user' ]['login' ]
4142 self .title = self .data ['issue' ]['title' ]
4243 self .body = self .data ['issue' ]['body' ]
@@ -60,8 +61,8 @@ def _create_submission_input(self):
6061 authors .append (
6162 Author (
6263 name = item .get ('name' , 'anyonymous' ),
63- affiliation = item .get ('institution ' ),
64- affiliation_url = item .get ('institution_url ' ),
64+ affiliation = item .get ('affiliation ' ),
65+ affiliation_url = item .get ('affiliation_url ' ),
6566 email = item .get ('email' , '' ),
6667 )
6768 )
@@ -77,6 +78,6 @@ def _create_submission_input(self):
7778
7879if __name__ == '__main__' :
7980 issue = IssueInfo (gh_event_path = os .environ ['GITHUB_EVENT_PATH' ]).create_submission ()
80- inputs = issue .submission .model_dump ()
81+ inputs = issue .submission .dict ()
8182 with open ('resource-gallery-submission-input.json' , 'w' ) as f :
8283 json .dump (inputs , f )
0 commit comments