Commit 8612ad6
Fix import-languages 500 errors and optimize DB performance (#14553)
* Fix import-languages endpoint 500 errors and optimize performance
The /api/v2/import-languages/ endpoint was producing 500 errors due to
database integrity issues on Language_Type and Languages models. This
commit addresses both reliability and performance.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix ruff lint errors in serializer and migration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Consolidate two migrations into single 0262_language_type_unique_language
Combines the data deduplication (RunPython) and schema change (AlterField)
into a single migration file.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix test fixtures conflicting with Language_Type unique constraint
Remove Language_Type entries from test fixtures that duplicate languages
already seeded by migration 0115_language_types. Update Languages FK
references to point to the correct seeded Language_Type PKs.
- dojo_testdata.json: Remove JSON (pk=1) and Python (pk=2) Language_Type
entries, update Languages FK from pk=1 to pk=94 (seeded JSON pk)
- dojo_testdata_locations.json: Same changes
- defect_dojo_sample_data.json: Remove 3 conflicting Language_Type entries
(DOS Batch, InstallShield, Ruby) with PKs that differ from seed data
- defect_dojo_sample_data_locations.json: Same changes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Renumber migration from 0262 to 0263 to avoid conflict
Migration 0262_remove_system_settings_credentials was merged to the
bugfix branch. Renumber our migration to 0263 and update the dependency
chain and max_migration.txt accordingly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent cad2cc2 commit 8612ad6
10 files changed
Lines changed: 2123 additions & 2069 deletions
File tree
- dojo
- api_v2
- db_migrations
- fixtures
- management/commands
- unittests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
2880 | 2881 | | |
2881 | 2882 | | |
2882 | 2883 | | |
2883 | | - | |
| 2884 | + | |
2884 | 2885 | | |
2885 | | - | |
2886 | | - | |
2887 | | - | |
2888 | | - | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
2889 | 2898 | | |
2890 | 2899 | | |
2891 | 2900 | | |
2892 | | - | |
2893 | | - | |
2894 | | - | |
2895 | | - | |
2896 | | - | |
2897 | | - | |
2898 | | - | |
2899 | | - | |
2900 | | - | |
2901 | | - | |
2902 | | - | |
| 2901 | + | |
| 2902 | + | |
2903 | 2903 | | |
2904 | 2904 | | |
2905 | | - | |
| 2905 | + | |
2906 | 2906 | | |
2907 | 2907 | | |
2908 | 2908 | | |
2909 | 2909 | | |
2910 | 2910 | | |
2911 | 2911 | | |
2912 | 2912 | | |
2913 | | - | |
2914 | | - | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
2915 | 2929 | | |
2916 | 2930 | | |
2917 | 2931 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments