@@ -33,12 +33,14 @@ def _update_submission(
3333 new_speaker_linkedin_url = "" ,
3434 new_speaker_facebook_url = "" ,
3535 new_speaker_mastodon_handle = "" ,
36+ new_speaker_availabilities = None ,
3637):
3738 new_title = new_title or {"en" : "new title to use" }
3839 new_elevator_pitch = new_elevator_pitch or {"en" : "This is an elevator pitch" }
3940 new_abstract = new_abstract or {"en" : "abstract here" }
4041 short_social_summary = new_short_social_summary or ""
4142 new_speaker_photo = new_speaker_photo or FileFactory ().id
43+ new_speaker_availabilities = new_speaker_availabilities or {}
4244
4345 return graphql_client .query (
4446 """
@@ -141,6 +143,7 @@ def _update_submission(
141143 "speakerLinkedinUrl" : new_speaker_linkedin_url ,
142144 "speakerFacebookUrl" : new_speaker_facebook_url ,
143145 "speakerMastodonHandle" : new_speaker_mastodon_handle ,
146+ "speakerAvailabilities" : new_speaker_availabilities ,
144147 }
145148 },
146149 )
@@ -201,6 +204,67 @@ def test_update_submission(graphql_client, user):
201204 assert participant .linkedin_url == "http://linkedin.com/company/pythonpizza"
202205
203206
207+ def test_update_submission_speaker_availabilities (graphql_client , user ):
208+ conference = ConferenceFactory (
209+ topics = ("life" , "diy" ),
210+ languages = ("it" , "en" ),
211+ durations = ("10" , "20" ),
212+ active_cfp = True ,
213+ audience_levels = ("adult" , "senior" ),
214+ submission_types = ("talk" , "workshop" ),
215+ )
216+
217+ submission = SubmissionFactory (
218+ speaker_id = user .id ,
219+ custom_topic = "life" ,
220+ custom_duration = "10m" ,
221+ custom_audience_level = "adult" ,
222+ custom_submission_type = "talk" ,
223+ languages = ["it" ],
224+ tags = ["python" , "ml" ],
225+ conference = conference ,
226+ speaker_level = Submission .SPEAKER_LEVELS .intermediate ,
227+ previous_talk_video = "https://www.youtube.com/watch?v=SlPhMPnQ58k" ,
228+ )
229+
230+ graphql_client .force_login (user )
231+
232+ new_topic = conference .topics .filter (name = "diy" ).first ()
233+ new_audience = conference .audience_levels .filter (name = "senior" ).first ()
234+ new_tag = SubmissionTagFactory (name = "yello" )
235+ new_duration = conference .durations .filter (name = "20m" ).first ()
236+ new_type = conference .submission_types .filter (name = "workshop" ).first ()
237+
238+ response = _update_submission (
239+ graphql_client ,
240+ submission = submission ,
241+ new_topic = new_topic ,
242+ new_audience = new_audience ,
243+ new_tag = new_tag ,
244+ new_duration = new_duration ,
245+ new_type = new_type ,
246+ new_speaker_level = Submission .SPEAKER_LEVELS .experienced ,
247+ new_speaker_availabilities = {
248+ "2023-12-10@am" : "unavailable" ,
249+ "2023-12-11@pm" : "unavailable" ,
250+ "2023-12-12@am" : "preferred" ,
251+ "2023-12-13@am" : None ,
252+ },
253+ )
254+
255+ submission .refresh_from_db ()
256+
257+ assert response ["data" ]["updateSubmission" ]["__typename" ] == "Submission"
258+
259+ participant = Participant .objects .first ()
260+ assert participant .speaker_availabilities == {
261+ "2023-12-10@am" : "unavailable" ,
262+ "2023-12-11@pm" : "unavailable" ,
263+ "2023-12-12@am" : "preferred" ,
264+ "2023-12-13@am" : None ,
265+ }
266+
267+
204268def test_update_submission_with_invalid_facebook_social_url (graphql_client , user ):
205269 conference = ConferenceFactory (
206270 topics = ("life" , "diy" ),
0 commit comments