@@ -1070,6 +1070,8 @@ def test_can_edit_submission_outside_cfp(graphql_client, user):
10701070 new_duration = new_duration ,
10711071 new_type = new_type ,
10721072 new_languages = ["en" ],
1073+ new_title = submission .title .data , # Keep title unchanged
1074+ new_abstract = submission .abstract .data , # Keep abstract unchanged
10731075 )
10741076
10751077 assert response ["data" ]["updateSubmission" ]["__typename" ] == "Submission"
@@ -1301,3 +1303,85 @@ def test_update_submission_with_do_not_record_true(graphql_client, user):
13011303
13021304 submission .refresh_from_db ()
13031305 assert submission .do_not_record is True
1306+
1307+
1308+ def test_cannot_update_title_after_cfp_deadline (graphql_client , user ):
1309+ conference = ConferenceFactory (
1310+ topics = ("life" , "diy" ),
1311+ languages = ("en" ,),
1312+ durations = ("10" , "20" ),
1313+ active_cfp = False , # CFP deadline is in the past
1314+ audience_levels = ("adult" , "senior" ),
1315+ submission_types = ("talk" , "workshop" ),
1316+ )
1317+
1318+ submission = SubmissionFactory (
1319+ speaker_id = user .id ,
1320+ custom_topic = "life" ,
1321+ custom_duration = "10m" ,
1322+ custom_audience_level = "adult" ,
1323+ custom_submission_type = "talk" ,
1324+ languages = ["en" ],
1325+ tags = ["python" , "ml" ],
1326+ conference = conference ,
1327+ )
1328+
1329+ original_title = submission .title .localize ("en" )
1330+
1331+ graphql_client .force_login (user )
1332+
1333+ response = _update_submission (
1334+ graphql_client ,
1335+ submission = submission ,
1336+ new_title = {"en" : "Updated Title After Deadline" },
1337+ )
1338+
1339+ assert response ["data" ]["updateSubmission" ]["__typename" ] == "SendSubmissionErrors"
1340+ assert response ["data" ]["updateSubmission" ]["errors" ]["validationTitle" ] == [
1341+ "You cannot edit the title after the call for proposals deadline has passed."
1342+ ]
1343+
1344+ # Verify the title was not updated
1345+ submission .refresh_from_db ()
1346+ assert submission .title .localize ("en" ) == original_title
1347+
1348+
1349+ def test_cannot_update_abstract_after_cfp_deadline (graphql_client , user ):
1350+ conference = ConferenceFactory (
1351+ topics = ("life" , "diy" ),
1352+ languages = ("en" ,),
1353+ durations = ("10" , "20" ),
1354+ active_cfp = False , # CFP deadline is in the past
1355+ audience_levels = ("adult" , "senior" ),
1356+ submission_types = ("talk" , "workshop" ),
1357+ )
1358+
1359+ submission = SubmissionFactory (
1360+ speaker_id = user .id ,
1361+ custom_topic = "life" ,
1362+ custom_duration = "10m" ,
1363+ custom_audience_level = "adult" ,
1364+ custom_submission_type = "talk" ,
1365+ languages = ["en" ],
1366+ tags = ["python" , "ml" ],
1367+ conference = conference ,
1368+ )
1369+
1370+ original_abstract = submission .abstract .localize ("en" )
1371+
1372+ graphql_client .force_login (user )
1373+
1374+ response = _update_submission (
1375+ graphql_client ,
1376+ submission = submission ,
1377+ new_abstract = {"en" : "Updated abstract after deadline" },
1378+ )
1379+
1380+ assert response ["data" ]["updateSubmission" ]["__typename" ] == "SendSubmissionErrors"
1381+ assert response ["data" ]["updateSubmission" ]["errors" ]["validationAbstract" ] == [
1382+ "You cannot edit the abstract after the call for proposals deadline has passed."
1383+ ]
1384+
1385+ # Verify the abstract was not updated
1386+ submission .refresh_from_db ()
1387+ assert submission .abstract .localize ("en" ) == original_abstract
0 commit comments