online-judge
online-judge copied to clipboard
Comment page is not changed when object code is changed
For example, a problem with code example
will have its comments stored in page p:example
. When the problem code is changed to example2
, the new page would be p:example2
. However, the existing comments still have page p:example
. As a result, all comments are lost (until the problem is renamed back to example
).
Comments on the editorial page may also be affected
https://github.com/DMOJ/online-judge/blob/617a321d03756c46e62986dfe2f6db4c944a5d9a/judge/views/problem.py#L146-L147
This needs to change to use the problem ID (and solution ID, for the editorial views). We should also have a migration that ports comments over to the id-based comment keys.
Comment locks are also affected, and would also need to be migrated.