Commit 03e1c39
committed
Fix FileUpload.copy() to prevent title length exceeding 100 chars
Fixes #11314
When copying a FileUpload, the copy() method appends ' - clone-{hash}'
(17 characters) to the title without checking if it would exceed the
database max_length constraint of 100 characters. This causes a
DataError when copying tests with files that have long names.
The fix truncates the original title before appending the clone suffix
to ensure the total length never exceeds 100 characters.1 parent f1861f9 commit 03e1c39
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
803 | 803 | | |
804 | 804 | | |
805 | 805 | | |
806 | | - | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
807 | 812 | | |
808 | 813 | | |
809 | 814 | | |
| |||
0 commit comments