Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Double saving when using django_debug_toolbar #318

Closed
hisie opened this Issue · 8 comments

5 participants

@hisie

I have just installed the debug toolbar and i have see that when i activate it and i do a method save from a ModelForm it execute two times the create query, while wihtout the debug toolbar is working fine.
I am using:
Python 2.7.2
Django 1.4.1
Debug toolbar 0.9.4
Registration 0.8

This is the debug_toolbar sqk panel:
Query Timeline Time (ms) Acción
+

SELECT ••• FROM django_session WHERE (django_session.session_key = 'f3ade7ddf8f20fd0485e53fa9569231a' AND django_session.expire_date > '2012-08-30 20:12:22' )
28,7429378531%
0,81 Sel Expl
+

SELECT ••• FROM auth_user WHERE auth_user.id = 1
20,3389830508%
0,58 Sel Expl
+

INSERT INTO evento_evento (nombre, descripcion, lugar, fecha_inicio, fecha_fin, numero_dias, tematica_id, privacidad, creador_id, fecha_creaccion, fecha_modificacion, fecha_en_votacion, lugar_en_votacion) VALUES ('Prueba github', '', '', NULL, NULL, NULL, NULL, 'semi', 1, '2012-08-30', '2012-08-30', 0, 0)
26,3771186441%
0,75

+

INSERT INTO evento_evento (nombre, descripcion, lugar, fecha_inicio, fecha_fin, numero_dias, tematica_id, privacidad, creador_id, fecha_creaccion, fecha_modificacion, fecha_en_votacion, lugar_en_votacion) VALUES ('Prueba github', '', '', NULL, NULL, NULL, NULL, 'semi', 1, '2012-08-30', '2012-08-30', 0, 0)
24,540960452%
0,70

And this is the progiling part:

Call CumTime Per TotTime Per Count

  • /home/hisie/workspace-python/preparala/evento/views.py in evento_form(8) 0,034 0,034 0,000 0,000 1
  • /django/forms/models.py in save(351) 0,009 0,009 0,000 0,000 1
  • /django/forms/models.py in save_instance(58) 0,009 0,009 0,000 0,000 1
  • /django/db/models/base.py in save(452) 0,009 0,009 0,000 0,000 1
  • /django/db/models/base.py in save_base(467) 0,009 0,009 0,000 0,000 1
  • /django/db/models/manager.py in _insert(202) 0,007 0,007 0,000 0,000 1
  • /django/db/models/query.py in insert_query(1568) 0,007 0,007 0,000 0,000 1
  • /django/db/models/sql/compiler.py in execute_sql(905) 0,007 0,007 0,000 0,000 1
  • /debug_toolbar/utils/tracking/db.py in execute(85) 0,007 0,007 0,000 0,000 1
  • /debug_toolbar/utils/init.py in tidy_stacktrace(22) 0,015 0,005 0,000 0,000 3 /home/hisie/workspace-python/preparala/../django14/lib/python2.7/posixpath.py in realpath(355) 0,014 0,000 0,001 0,000 84
  • /debug_toolbar/utils/init.py in get_stack(143) 0,007 0,002 0,000 0,000 3 /debug_toolbar/utils/init.py in getframeinfo(101) 0,007 0,000 0,001 0,000 84
@kkumler

@hisie Was the profiling panel enabled?

@hisie

Sorry kkumler i have just deactivate it. I will send you a copy of the settings.py when i can.

@kunitoki

Yes, i'm experimenting the same behaviour. The profiler module executes the page two times (and when submitting forms that produces 2 subsequent form submit).

@Uznick

Strange problem here -- when I use the profiler module -- all sql requests and templates in other debug panels are doubled.

@kunitoki

any news on this problem ?

@aaugustin
Owner

#348 is probably a duplicate.

@aaugustin aaugustin closed this
@aaugustin
Owner

Oops.

@aaugustin aaugustin reopened this
@aaugustin
Owner

This was fixed in c9d3f34. I added a test in 8a591b8.

@aaugustin aaugustin closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.