Ticket #26347: m2m_django_1.9

File m2m_django_1.9, 5.3 KB (added by Hugo Chargois, 9 years ago)
Line 
1# this happens when, in the admin site, I add an object (id#676) to a M2M field in
2# object id#3623, and I double-click on "save". One of the two requests succeeds, one
3# fails with the following:
4
5Traceback:
6
7File "[...]/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
8 149. response = self.process_exception_by_middleware(e, request)
9
10File "[...]/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
11 147. response = wrapped_callback(request, *callback_args, **callback_kwargs)
12
13File "[...]/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
14 541. return self.admin_site.admin_view(view)(*args, **kwargs)
15
16File "[...]/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
17 149. response = view_func(request, *args, **kwargs)
18
19File "[...]/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
20 57. response = view_func(request, *args, **kwargs)
21
22File "[...]/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
23 244. return view(request, *args, **kwargs)
24
25File "[...]/lib/python2.7/site-packages/django/contrib/admin/options.py" in change_view
26 1440. return self.changeform_view(request, object_id, form_url, extra_context)
27
28File "[...]/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
29 67. return bound_func(*args, **kwargs)
30
31File "[...]/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
32 149. response = view_func(request, *args, **kwargs)
33
34File "[...]/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
35 63. return func.__get__(self, type(self))(*args2, **kwargs2)
36
37File "[...]/lib/python2.7/site-packages/django/utils/decorators.py" in inner
38 184. return func(*args, **kwargs)
39
40File "[...]/lib/python2.7/site-packages/django/contrib/admin/options.py" in changeform_view
41 1379. self.save_related(request, form, formsets, not add)
42
43File "[...]/lib/python2.7/site-packages/django/contrib/admin/options.py" in save_related
44 1013. form.save_m2m()
45
46File "[...]/lib/python2.7/site-packages/django/forms/models.py" in _save_m2m
47 434. f.save_form_data(self.instance, cleaned_data[f.name])
48
49File "[...]/lib/python2.7/site-packages/django/db/models/fields/related.py" in save_form_data
50 1618. setattr(instance, self.attname, data)
51
52File "[...]/lib/python2.7/site-packages/django/db/models/fields/related_descriptors.py" in __set__
53 481. manager.set(value)
54
55File "[...]/lib/python2.7/site-packages/django/db/models/fields/related_descriptors.py" in set
56 910. self.add(*new_objs)
57
58File "[...]/lib/python2.7/site-packages/django/db/models/fields/related_descriptors.py" in add
59 843. self._add_items(self.source_field_name, self.target_field_name, *objs)
60
61File "[...]/lib/python2.7/site-packages/django/db/models/fields/related_descriptors.py" in _add_items
62 1004. for obj_id in new_ids
63
64File "[...]/lib/python2.7/site-packages/django/db/models/query.py" in bulk_create
65 450. self._batched_insert(objs_without_pk, fields, batch_size)
66
67File "[...]/lib/python2.7/site-packages/django/db/models/query.py" in _batched_insert
68 1056. using=self.db)
69
70File "[...]/lib/python2.7/site-packages/django/db/models/manager.py" in manager_method
71 122. return getattr(self.get_queryset(), name)(*args, **kwargs)
72
73File "[...]/lib/python2.7/site-packages/django/db/models/query.py" in _insert
74 1039. return query.get_compiler(using=using).execute_sql(return_id)
75
76File "[...]/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
77 1060. cursor.execute(sql, params)
78
79File "[...]/lib/python2.7/site-packages/debug_toolbar/panels/sql/tracking.py" in execute
80 159. return self._record(self.cursor.execute, sql, params)
81
82File "[...]/lib/python2.7/site-packages/debug_toolbar/panels/sql/tracking.py" in _record
83 101. return method(sql, params)
84
85File "[...]/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
86 79. return super(CursorDebugWrapper, self).execute(sql, params)
87
88File "[...]/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
89 64. return self.cursor.execute(sql, params)
90
91File "[...]/lib/python2.7/site-packages/django/db/utils.py" in __exit__
92 95. six.reraise(dj_exc_type, dj_exc_value, traceback)
93
94File "[...]/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
95 64. return self.cursor.execute(sql, params)
96
97File "[...]/lib/python2.7/site-packages/django/db/backends/mysql/base.py" in execute
98 112. return self.cursor.execute(query, args)
99
100File "[...]/lib/python2.7/site-packages/MySQLdb/cursors.py" in execute
101 226. self.errorhandler(self, exc, value)
102
103File "[...]/lib/python2.7/site-packages/MySQLdb/connections.py" in defaulterrorhandler
104 36. raise errorvalue
105
106Exception Type: IntegrityError at /admin/[...]/[...]/3623/change/
107Exception Value: (1062, "Duplicate entry '3623-676' for key 'from_[...]_id'")
108
109
110
111
112
113
114
115
116
117
118
119
120
Back to Top