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 |
|
---|
5 | Traceback:
|
---|
6 |
|
---|
7 | File "[...]/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
|
---|
8 | 149. response = self.process_exception_by_middleware(e, request)
|
---|
9 |
|
---|
10 | File "[...]/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
|
---|
11 | 147. response = wrapped_callback(request, *callback_args, **callback_kwargs)
|
---|
12 |
|
---|
13 | File "[...]/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
|
---|
14 | 541. return self.admin_site.admin_view(view)(*args, **kwargs)
|
---|
15 |
|
---|
16 | File "[...]/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
|
---|
17 | 149. response = view_func(request, *args, **kwargs)
|
---|
18 |
|
---|
19 | File "[...]/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
|
---|
20 | 57. response = view_func(request, *args, **kwargs)
|
---|
21 |
|
---|
22 | File "[...]/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
|
---|
23 | 244. return view(request, *args, **kwargs)
|
---|
24 |
|
---|
25 | File "[...]/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 |
|
---|
28 | File "[...]/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
|
---|
29 | 67. return bound_func(*args, **kwargs)
|
---|
30 |
|
---|
31 | File "[...]/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
|
---|
32 | 149. response = view_func(request, *args, **kwargs)
|
---|
33 |
|
---|
34 | File "[...]/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
|
---|
35 | 63. return func.__get__(self, type(self))(*args2, **kwargs2)
|
---|
36 |
|
---|
37 | File "[...]/lib/python2.7/site-packages/django/utils/decorators.py" in inner
|
---|
38 | 184. return func(*args, **kwargs)
|
---|
39 |
|
---|
40 | File "[...]/lib/python2.7/site-packages/django/contrib/admin/options.py" in changeform_view
|
---|
41 | 1379. self.save_related(request, form, formsets, not add)
|
---|
42 |
|
---|
43 | File "[...]/lib/python2.7/site-packages/django/contrib/admin/options.py" in save_related
|
---|
44 | 1013. form.save_m2m()
|
---|
45 |
|
---|
46 | File "[...]/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 |
|
---|
49 | File "[...]/lib/python2.7/site-packages/django/db/models/fields/related.py" in save_form_data
|
---|
50 | 1618. setattr(instance, self.attname, data)
|
---|
51 |
|
---|
52 | File "[...]/lib/python2.7/site-packages/django/db/models/fields/related_descriptors.py" in __set__
|
---|
53 | 481. manager.set(value)
|
---|
54 |
|
---|
55 | File "[...]/lib/python2.7/site-packages/django/db/models/fields/related_descriptors.py" in set
|
---|
56 | 910. self.add(*new_objs)
|
---|
57 |
|
---|
58 | File "[...]/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 |
|
---|
61 | File "[...]/lib/python2.7/site-packages/django/db/models/fields/related_descriptors.py" in _add_items
|
---|
62 | 1004. for obj_id in new_ids
|
---|
63 |
|
---|
64 | File "[...]/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 |
|
---|
67 | File "[...]/lib/python2.7/site-packages/django/db/models/query.py" in _batched_insert
|
---|
68 | 1056. using=self.db)
|
---|
69 |
|
---|
70 | File "[...]/lib/python2.7/site-packages/django/db/models/manager.py" in manager_method
|
---|
71 | 122. return getattr(self.get_queryset(), name)(*args, **kwargs)
|
---|
72 |
|
---|
73 | File "[...]/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 |
|
---|
76 | File "[...]/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
|
---|
77 | 1060. cursor.execute(sql, params)
|
---|
78 |
|
---|
79 | File "[...]/lib/python2.7/site-packages/debug_toolbar/panels/sql/tracking.py" in execute
|
---|
80 | 159. return self._record(self.cursor.execute, sql, params)
|
---|
81 |
|
---|
82 | File "[...]/lib/python2.7/site-packages/debug_toolbar/panels/sql/tracking.py" in _record
|
---|
83 | 101. return method(sql, params)
|
---|
84 |
|
---|
85 | File "[...]/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
|
---|
86 | 79. return super(CursorDebugWrapper, self).execute(sql, params)
|
---|
87 |
|
---|
88 | File "[...]/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
|
---|
89 | 64. return self.cursor.execute(sql, params)
|
---|
90 |
|
---|
91 | File "[...]/lib/python2.7/site-packages/django/db/utils.py" in __exit__
|
---|
92 | 95. six.reraise(dj_exc_type, dj_exc_value, traceback)
|
---|
93 |
|
---|
94 | File "[...]/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
|
---|
95 | 64. return self.cursor.execute(sql, params)
|
---|
96 |
|
---|
97 | File "[...]/lib/python2.7/site-packages/django/db/backends/mysql/base.py" in execute
|
---|
98 | 112. return self.cursor.execute(query, args)
|
---|
99 |
|
---|
100 | File "[...]/lib/python2.7/site-packages/MySQLdb/cursors.py" in execute
|
---|
101 | 226. self.errorhandler(self, exc, value)
|
---|
102 |
|
---|
103 | File "[...]/lib/python2.7/site-packages/MySQLdb/connections.py" in defaulterrorhandler
|
---|
104 | 36. raise errorvalue
|
---|
105 |
|
---|
106 | Exception Type: IntegrityError at /admin/[...]/[...]/3623/change/
|
---|
107 | Exception Value: (1062, "Duplicate entry '3623-676' for key 'from_[...]_id'")
|
---|
108 |
|
---|
109 |
|
---|
110 |
|
---|
111 |
|
---|
112 |
|
---|
113 |
|
---|
114 |
|
---|
115 |
|
---|
116 |
|
---|
117 |
|
---|
118 |
|
---|
119 |
|
---|
120 |
|
---|