@@ -122,6 +122,7 @@ def _update_submission(
122122 validationNotes: notes
123123 validationTopic: topic
124124 validationAbstract: abstract
125+ validationElevatorPitch: elevatorPitch
125126 validationDuration: duration
126127 validationAudienceLevel: audienceLevel
127128 validationType: type
@@ -1070,6 +1071,9 @@ def test_can_edit_submission_outside_cfp(graphql_client, user):
10701071 new_duration = new_duration ,
10711072 new_type = new_type ,
10721073 new_languages = ["en" ],
1074+ new_title = submission .title .data , # Keep title unchanged
1075+ new_abstract = submission .abstract .data , # Keep abstract unchanged
1076+ new_elevator_pitch = submission .elevator_pitch .data , # Keep elevator pitch unchanged
10731077 )
10741078
10751079 assert response ["data" ]["updateSubmission" ]["__typename" ] == "Submission"
@@ -1301,3 +1305,120 @@ def test_update_submission_with_do_not_record_true(graphql_client, user):
13011305
13021306 submission .refresh_from_db ()
13031307 assert submission .do_not_record is True
1308+
1309+
1310+ def test_accepted_submission_can_edit_restricted_fields_after_cfp_deadline (
1311+ graphql_client , user
1312+ ):
1313+ """Accepted submissions can edit title, abstract, and elevator_pitch when CFP is closed."""
1314+ conference = ConferenceFactory (
1315+ topics = ("life" , "diy" ),
1316+ languages = ("en" ,),
1317+ durations = ("10" , "20" ),
1318+ active_cfp = False , # CFP deadline is in the past
1319+ audience_levels = ("adult" , "senior" ),
1320+ submission_types = ("talk" , "workshop" ),
1321+ )
1322+
1323+ submission = SubmissionFactory (
1324+ speaker_id = user .id ,
1325+ status = Submission .STATUS .accepted ,
1326+ custom_topic = "life" ,
1327+ custom_duration = "10m" ,
1328+ custom_audience_level = "adult" ,
1329+ custom_submission_type = "talk" ,
1330+ languages = ["en" ],
1331+ tags = ["python" , "ml" ],
1332+ conference = conference ,
1333+ )
1334+
1335+ graphql_client .force_login (user )
1336+
1337+ response = _update_submission (
1338+ graphql_client ,
1339+ submission = submission ,
1340+ new_title = {"en" : "Updated Title After Deadline - Accepted" },
1341+ new_abstract = {"en" : "Updated abstract after deadline - Accepted" },
1342+ new_elevator_pitch = {"en" : "Updated elevator pitch after deadline - Accepted" },
1343+ )
1344+
1345+ assert response ["data" ]["updateSubmission" ]["__typename" ] == "Submission"
1346+ assert (
1347+ response ["data" ]["updateSubmission" ]["title" ]
1348+ == "Updated Title After Deadline - Accepted"
1349+ )
1350+ assert (
1351+ response ["data" ]["updateSubmission" ]["abstract" ]
1352+ == "Updated abstract after deadline - Accepted"
1353+ )
1354+ assert (
1355+ response ["data" ]["updateSubmission" ]["elevatorPitch" ]
1356+ == "Updated elevator pitch after deadline - Accepted"
1357+ )
1358+ submission .refresh_from_db ()
1359+ assert submission .title .localize ("en" ) == "Updated Title After Deadline - Accepted"
1360+ assert (
1361+ submission .abstract .localize ("en" )
1362+ == "Updated abstract after deadline - Accepted"
1363+ )
1364+ assert (
1365+ submission .elevator_pitch .localize ("en" )
1366+ == "Updated elevator pitch after deadline - Accepted"
1367+ )
1368+
1369+
1370+ def test_non_accepted_submission_cannot_edit_restricted_fields_after_cfp_deadline (
1371+ graphql_client , user
1372+ ):
1373+ """Non-accepted submissions cannot edit title, abstract, or elevator_pitch when CFP is closed."""
1374+ conference = ConferenceFactory (
1375+ topics = ("life" , "diy" ),
1376+ languages = ("en" ,),
1377+ durations = ("10" , "20" ),
1378+ active_cfp = False , # CFP deadline is in the past
1379+ audience_levels = ("adult" , "senior" ),
1380+ submission_types = ("talk" , "workshop" ),
1381+ )
1382+
1383+ submission = SubmissionFactory (
1384+ speaker_id = user .id ,
1385+ status = Submission .STATUS .proposed ,
1386+ custom_topic = "life" ,
1387+ custom_duration = "10m" ,
1388+ custom_audience_level = "adult" ,
1389+ custom_submission_type = "talk" ,
1390+ languages = ["en" ],
1391+ tags = ["python" , "ml" ],
1392+ conference = conference ,
1393+ )
1394+
1395+ original_title = submission .title .localize ("en" )
1396+ original_abstract = submission .abstract .localize ("en" )
1397+ original_elevator_pitch = submission .elevator_pitch .localize ("en" )
1398+
1399+ graphql_client .force_login (user )
1400+
1401+ response = _update_submission (
1402+ graphql_client ,
1403+ submission = submission ,
1404+ new_title = {"en" : "Updated Title After Deadline" },
1405+ new_abstract = {"en" : "Updated abstract after deadline" },
1406+ new_elevator_pitch = {"en" : "Updated elevator pitch after deadline" },
1407+ )
1408+
1409+ assert response ["data" ]["updateSubmission" ]["__typename" ] == "SendSubmissionErrors"
1410+ assert response ["data" ]["updateSubmission" ]["errors" ]["validationTitle" ] == [
1411+ "You cannot edit the title after the call for proposals deadline has passed."
1412+ ]
1413+ assert response ["data" ]["updateSubmission" ]["errors" ]["validationAbstract" ] == [
1414+ "You cannot edit the abstract after the call for proposals deadline has passed."
1415+ ]
1416+ assert response ["data" ]["updateSubmission" ]["errors" ][
1417+ "validationElevatorPitch"
1418+ ] == [
1419+ "You cannot edit the elevator pitch after the call for proposals deadline has passed."
1420+ ]
1421+ submission .refresh_from_db ()
1422+ assert submission .title .localize ("en" ) == original_title
1423+ assert submission .abstract .localize ("en" ) == original_abstract
1424+ assert submission .elevator_pitch .localize ("en" ) == original_elevator_pitch
0 commit comments