Project

General

Profile

Actions

Anomalie #102

closed

Admin / BUG in Creation of individuals

Added by Yann Le Jeune almost 14 years ago. Updated over 13 years ago.

Status:
Fermé
Priority:
Haut
Assignee:
Category:
-
Target version:
Start date:
18 January 2011
Due date:
% Done:

100%

Estimated time:
Élément(s):
Difficulté:

Description

The creation of an individual is bugged. After the Confirmation panel the Validation button brings this :

IntegrityError at /ishtar/person_creation/done

ERREUR: une valeur NULL viole la contrainte NOT NULL de la colonne « id »

Request Method: GET

Request URL: http://lysithea.proxience.com/ishtar/person_creation/done

Django Version: 1.2.3

Exception Type: IntegrityError

Exception Value:

ERREUR: une valeur NULL viole la contrainte NOT NULL de la colonne « id »

Exception Location: /usr/lib/pymodules/python2.6/django/db/backends/postgresql_psycopg2/base.py in execute, line 44

Python Executable: /usr/bin/python

Python Version: 2.6.6

Python Path: ['/var/local/ishtar/', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/local/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages', '/usr/lib/pymodules/python2.6']

Server time: mar, 18 Jan 2011 22:29:47 +0100

Traceback Switch to copy-and-paste view

* /usr/lib/pymodules/python2.6/django/core/handlers/base.py in get_response

    93. # Apply view middleware

    94. for middleware_method in self._view_middleware:

    95. response = middleware_method(request, callback, callback_args, callback_kwargs)

    96. if response:

    97. return response

    98.

    99. try:

   100. response = callback(request, *callback_args, **callback_kwargs) ...

   101. except Exception, e:

   102. # If the view raised an exception, run it through exception

   103. # middleware, and if the exception middleware returns a

   104. # response, use that. Otherwise, reraise the exception.

   105. for middleware_method in self._exception_middleware:

   106. response = middleware_method(request, e)

  ▶ Local vars

  Variable  Value

  callback  

  person_creation: form_list: {u'identity-person_creation': <class 'ishtar.furnitures.forms.PersonForm'>, u'final-person_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

  callback_args     

  ()

  callback_kwargs   

  {'step': u'done'}

  e     

  IntegrityError('ERREUR: une valeur NULL viole la contrainte NOT NULL de la colonne \xc2\xab id \xc2\xbb\n',)

  exceptions    

  <module 'django.core.exceptions' from '/usr/lib/pymodules/python2.6/django/core/exceptions.pyc'>

  middleware_method     

  <bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0x7fcdce88e810>>

  receivers     

  [(<function _rollback_on_exception at 0x7fcdcd6df8c0>, None)]

  request   

  <ModPythonRequest path:/ishtar/person_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': '6a80973cc55777251c04ab48a2a09c90', 'sessionid': 'ee76b88e70f27ebe5e56e4c2dd9abfcd'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': '6a80973cc55777251c04ab48a2a09c90', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'csrftoken=6a80973cc55777251c04ab48a2a09c90; sessionid=ee76b88e70f27ebe5e56e4c2dd9abfcd', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_KEEP_ALIVE': '115', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13', 'PATH_INFO': u'/ishtar/person_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '62.147.149.24', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  resolver  

  <RegexURLResolver ishtar.urls (None:None) ^/>

  response  

  None

  self  

  <django.core.handlers.modpython.ModPythonHandler object at 0x7fcdcd467e90>

  settings  

  <django.conf.LazySettings object at 0x7fcdcd331710>

  urlconf   

  'ishtar.urls'

  urlresolvers  

  <module 'django.core.urlresolvers' from '/usr/lib/pymodules/python2.6/django/core/urlresolvers.pyc'>

* /usr/local/lib/python2.6/dist-packages/formwizard/forms.py in __call__

    78.

    79. After processing the request using the `process_request` method, the

    80. response gets updated by the storage engine (for example add cookies).

    81. """

    82.

    83. storage = get_storage(self.storage_name,

    84. self.get_wizard_name(), request, getattr(self, 'file_storage', None))

    85. response = self.process_request(request, storage, *args, **kwargs) ...

    86. storage.update_response(response)

    87.

    88. if kwargs.get('testmode', False):

    89. return response, storage

    90. else:

    91. return response

  ▶ Local vars

  Variable  Value

  args  

  ()

  kwargs    

  {'step': u'done'}

  request   

  <ModPythonRequest path:/ishtar/person_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': '6a80973cc55777251c04ab48a2a09c90', 'sessionid': 'ee76b88e70f27ebe5e56e4c2dd9abfcd'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': '6a80973cc55777251c04ab48a2a09c90', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'csrftoken=6a80973cc55777251c04ab48a2a09c90; sessionid=ee76b88e70f27ebe5e56e4c2dd9abfcd', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_KEEP_ALIVE': '115', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13', 'PATH_INFO': u'/ishtar/person_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '62.147.149.24', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  self  

  person_creation: form_list: {u'identity-person_creation': <class 'ishtar.furnitures.forms.PersonForm'>, u'final-person_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

  storage   

  <formwizard.storage.session.SessionStorage object at 0x7fcdcd4ddf10>

* /usr/local/lib/python2.6/dist-packages/formwizard/forms.py in process_request

    92.

    93. def process_request(self, request, *args, **kwargs):

    94. """

    95. Returns a response generated by either `process_get_request` or

    96. `process_post_request` (depends on `request.method`).

    97. """

    98. if request.method == 'GET':

    99. return self.process_get_request(request, *args, **kwargs) ...

   100. else:

   101. return self.process_post_request(request, *args, **kwargs)

   102.

   103. def process_get_request(self, request, storage, *args, **kwargs):

   104. """

   105. If the wizard gets a GET request, it assumes that the user just

  ▶ Local vars

  Variable  Value

  args  

  (<formwizard.storage.session.SessionStorage object at 0x7fcdcd4ddf10>,)

  kwargs    

  {'step': u'done'}

  request   

  <ModPythonRequest path:/ishtar/person_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': '6a80973cc55777251c04ab48a2a09c90', 'sessionid': 'ee76b88e70f27ebe5e56e4c2dd9abfcd'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': '6a80973cc55777251c04ab48a2a09c90', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'csrftoken=6a80973cc55777251c04ab48a2a09c90; sessionid=ee76b88e70f27ebe5e56e4c2dd9abfcd', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_KEEP_ALIVE': '115', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13', 'PATH_INFO': u'/ishtar/person_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '62.147.149.24', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  self  

  person_creation: form_list: {u'identity-person_creation': <class 'ishtar.furnitures.forms.PersonForm'>, u'final-person_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

* /usr/local/lib/python2.6/dist-packages/formwizard/forms.py in process_get_request

   537. if step_url == self.done_step_name:

   538. return self.render_done(request, storage,

   539. self.get_form(request, storage,

   540. step=self.get_last_step(request, storage),

   541. data=storage.get_step_data(

   542. self.get_last_step(request, storage)),

   543. files=storage.get_step_files(

   544. self.get_last_step(request, storage))), **kwargs) ...

   545.

   546. # is the url step name not equal to the step in the storage?

   547. # if yes, change the step in the storage (if name exists)

   548. if step_url <> self.determine_step(request, storage):

   549. if self.get_form_list(request, storage).has_key(step_url):

   550. storage.set_current_step(step_url)

  ▶ Local vars

  Variable  Value

  args  

  ()

  kwargs    

  {'step': u'done'}

  request   

  <ModPythonRequest path:/ishtar/person_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': '6a80973cc55777251c04ab48a2a09c90', 'sessionid': 'ee76b88e70f27ebe5e56e4c2dd9abfcd'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': '6a80973cc55777251c04ab48a2a09c90', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'csrftoken=6a80973cc55777251c04ab48a2a09c90; sessionid=ee76b88e70f27ebe5e56e4c2dd9abfcd', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_KEEP_ALIVE': '115', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13', 'PATH_INFO': u'/ishtar/person_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '62.147.149.24', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  self  

  person_creation: form_list: {u'identity-person_creation': <class 'ishtar.furnitures.forms.PersonForm'>, u'final-person_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

  step_url  

  u'done'

  storage   

  <formwizard.storage.session.SessionStorage object at 0x7fcdcd4ddf10>

* /usr/local/lib/python2.6/dist-packages/formwizard/forms.py in render_done

   613. step_url = kwargs.get('step', None)

   614. if step_url <> self.done_step_name:

   615. return HttpResponseRedirect(reverse(self.url_name, kwargs={

   616. 'step': self.done_step_name

   617. }))

   618.

   619. return super(NamedUrlFormWizard, self).render_done(

   620. request, storage, form, **kwargs) ...

   621.

   622.

   623. class NamedUrlSessionFormWizard(NamedUrlFormWizard):

   624. """

   625. A NamedUrlFormWizard with pre-configured SessionStorageBackend.

   626. """

  ▶ Local vars

  Variable  Value

  form  

  <ishtar.furnitures.forms.FinalForm object at 0x7fcdce92b290>

  kwargs    

  {'step': u'done'}

  request   

  <ModPythonRequest path:/ishtar/person_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': '6a80973cc55777251c04ab48a2a09c90', 'sessionid': 'ee76b88e70f27ebe5e56e4c2dd9abfcd'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': '6a80973cc55777251c04ab48a2a09c90', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'csrftoken=6a80973cc55777251c04ab48a2a09c90; sessionid=ee76b88e70f27ebe5e56e4c2dd9abfcd', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_KEEP_ALIVE': '115', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13', 'PATH_INFO': u'/ishtar/person_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '62.147.149.24', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  self  

  person_creation: form_list: {u'identity-person_creation': <class 'ishtar.furnitures.forms.PersonForm'>, u'final-person_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

  step_url  

  u'done'

  storage   

  <formwizard.storage.session.SessionStorage object at 0x7fcdcd4ddf10>

* /usr/local/lib/python2.6/dist-packages/formwizard/forms.py in render_done

   179. form_obj = self.get_form(request, storage, step=form_key,

   180. data=storage.get_step_data(form_key),

   181. files=storage.get_step_files(form_key))

   182. if not form_obj.is_valid():

   183. return self.render_revalidation_failure(request, storage,

   184. form_key, form_obj, **kwargs)

   185. final_form_list.append(form_obj)

   186. done_response = self.done(request, storage, final_form_list, **kwargs) ...

   187. self.reset_wizard(request, storage)

   188. return done_response

   189.

   190. def get_form_prefix(self, request, storage, step=None, form=None):

   191. """

   192. Returns the prefix which will be used when calling the actual form for

  ▶ Local vars

  Variable  Value

  final_form_list   

  [<ishtar.furnitures.forms.PersonForm object at 0x7fcdce862710>, <ishtar.furnitures.forms.FinalForm object at 0x7fcdce883a90>]

  form  

  <ishtar.furnitures.forms.FinalForm object at 0x7fcdce92b290>

  form_key  

  u'final-person_creation'

  form_obj  

  <ishtar.furnitures.forms.FinalForm object at 0x7fcdce883a90>

  kwargs    

  {'step': u'done'}

  request   

  <ModPythonRequest path:/ishtar/person_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': '6a80973cc55777251c04ab48a2a09c90', 'sessionid': 'ee76b88e70f27ebe5e56e4c2dd9abfcd'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': '6a80973cc55777251c04ab48a2a09c90', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'csrftoken=6a80973cc55777251c04ab48a2a09c90; sessionid=ee76b88e70f27ebe5e56e4c2dd9abfcd', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_KEEP_ALIVE': '115', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13', 'PATH_INFO': u'/ishtar/person_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '62.147.149.24', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  self  

  person_creation: form_list: {u'identity-person_creation': <class 'ishtar.furnitures.forms.PersonForm'>, u'final-person_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

  storage   

  <formwizard.storage.session.SessionStorage object at 0x7fcdcd4ddf10>

* /var/local/ishtar/ishtar/furnitures/forms.py in done

   194. if obj:

   195. for k in dct:

   196. if k.startswith('pk'):

   197. continue

   198. setattr(obj, k, dct[k])

   199. else:

   200. obj = self.model(**dct)

   201. obj.save() ...

   202. for key, value in m2m:

   203. if value not in getattr(obj, key+'s').all():

   204. getattr(obj, key+'s').add(value)

   205. obj.save()

   206. res = render_to_response('wizard_done.html', {},

   207. context_instance=RequestContext(request))

  ▶ Local vars

  Variable  Value

  associated_models     

  {}

  base_form     

  <ishtar.furnitures.forms.FinalForm object at 0x7fcdce883a90>

  dct   

  {'attached_to': <Organization: Centre archéologique européen de Bibracte>, 'email': u'bruno.desachy@gmail.com', 'history_modifier': <User: lj.yann>, 'in_charge_storage': None, 'is_author': True, 'name': u'desachy', 'person_type': <PersonType: Administrateur>, 'surname': u'bruno', 'title': u'Mr'}

  form  

  <ishtar.furnitures.forms.FinalForm object at 0x7fcdce883a90>

  form_list     

  [<ishtar.furnitures.forms.PersonForm object at 0x7fcdce862710>, <ishtar.furnitures.forms.FinalForm object at 0x7fcdce883a90>]

  key   

  'email'

  kwargs    

  {'step': u'done'}

  m2m   

  []

  obj   

  <Person: desachy bruno - Centre archéologique européen de Bibracte>

  request   

  <ModPythonRequest path:/ishtar/person_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': '6a80973cc55777251c04ab48a2a09c90', 'sessionid': 'ee76b88e70f27ebe5e56e4c2dd9abfcd'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': '6a80973cc55777251c04ab48a2a09c90', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'csrftoken=6a80973cc55777251c04ab48a2a09c90; sessionid=ee76b88e70f27ebe5e56e4c2dd9abfcd', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_KEEP_ALIVE': '115', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13', 'PATH_INFO': u'/ishtar/person_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '62.147.149.24', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  return_object     

  False

  self  

  person_creation: form_list: {u'identity-person_creation': <class 'ishtar.furnitures.forms.PersonForm'>, u'final-person_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

  storage   

  <formwizard.storage.session.SessionStorage object at 0x7fcdcd4ddf10>

  value     

  u'bruno.desachy@gmail.com'

* /var/local/ishtar/ishtar/furnitures/models.py in save

   127. history_modifier = models.ForeignKey(User, related_name='+',

   128. verbose_name=_(u"Last modifier"))

   129. def save(self, *args, **kwargs):

   130. try:

   131. self.history_modifier

   132. except ObjectDoesNotExist:

   133. return

   134. super(BaseHistorizedItem, self).save(*args, **kwargs) ...

   135. return True

   136.

   137. class Meta:

   138. abstract = True

   139.

   140. class LightHistorizedItem(BaseHistorizedItem):

  ▶ Local vars

  Variable  Value

  args  

  ()

  kwargs    

  {}

  self  

  <Person: desachy bruno - Centre archéologique européen de Bibracte>

* /usr/lib/pymodules/python2.6/django/db/models/base.py in save

   427.

   428. The 'force_insert' and 'force_update' parameters can be used to insist

   429. that the "save" must be an SQL insert or update (or equivalent for

   430. non-SQL backends), respectively. Normally, they should not be set.

   431. """

   432. if force_insert and force_update:

   433. raise ValueError("Cannot force both insert and updating in model saving.")

   434. self.save_base(using=using, force_insert=force_insert, force_update=force_update) ...

   435.

   436. save.alters_data = True

   437.

   438. def save_base(self, raw=False, cls=None, origin=None, force_insert=False,

   439. force_update=False, using=None):

   440. """

  ▶ Local vars

  Variable  Value

  force_insert  

  False

  force_update  

  False

  self  

  <Person: desachy bruno - Centre archéologique européen de Bibracte>

  using     

  None

* /usr/lib/pymodules/python2.6/django/db/models/base.py in save_base

   520. for f in meta.local_fields]

   521.

   522. record_exists = False

   523.

   524. update_pk = bool(meta.has_auto_field and not pk_set)

   525. if values:

   526. # Create a new record.

   527. result = manager._insert(values, return_id=update_pk, using=using) ...

   528. else:

   529. # Create a new record with defaults for everything.

   530. result = manager._insert([(meta.pk, connection.ops.pk_default_value())], return_id=update_pk, raw_values=True, using=using)

   531.

   532. if update_pk:

   533. setattr(self, meta.pk.attname, result)

  ▶ Local vars

  Variable  Value

  cls   

  <class 'ishtar.furnitures.models.Person'>

  connection    

  <django.contrib.gis.db.backends.postgis.base.DatabaseWrapper object at 0x7fcdcd6eef18>

  f     

  <django.db.models.fields.NullBooleanField object at 0x7fcdcde99790>

  force_insert  

  False

  force_update  

  False

  manager   

  <django.db.models.manager.Manager object at 0x7fcdcde9b050>

  meta  

  <Options for Person>

  non_pks   

  [<django.db.models.fields.related.ForeignKey object at 0x7fcdcde99c90>, <django.db.models.fields.TextField object at 0x7fcdcde99e10>, <django.db.models.fields.TextField object at 0x7fcdcde99e50>, <django.db.models.fields.CharField object at 0x7fcdcde99e90>, <django.db.models.fields.CharField object at 0x7fcdcde99ed0>, <django.db.models.fields.CharField object at 0x7fcdcde99f10>, <django.db.models.fields.CharField object at 0x7fcdcde99f50>, <django.db.models.fields.CharField object at 0x7fcdcde99f90>, <django.db.models.fields.CharField object at 0x7fcdcde99050>, <django.db.models.fields.CharField object at 0x7fcdcde991d0>, <django.db.models.fields.CharField object at 0x7fcdcde992d0>, <django.db.models.fields.CharField object at 0x7fcdcde993d0>, <django.db.models.fields.related.ForeignKey object at 0x7fcdcde994d0>, <django.db.models.fields.related.ForeignKey object at 0x7fcdcde995d0>, <django.db.models.fields.NullBooleanField object at 0x7fcdcde99710>, <django.db.models.fields.NullBooleanField object at 0x7fcdcde99790>]

  org   

  None

  origin    

  <class 'ishtar.furnitures.models.Person'>

  pk_set    

  False

  pk_val    

  None

  raw   

  False

  record_exists     

  False

  self  

  <Person: desachy bruno - Centre archéologique européen de Bibracte>

  update_pk     

  True

  using     

  'default'

  values    

  [(<django.db.models.fields.related.ForeignKey object at 0x7fcdcde99c90>, 1), (<django.db.models.fields.TextField object at 0x7fcdcde99e10>, None), (<django.db.models.fields.TextField object at 0x7fcdcde99e50>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99e90>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99ed0>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99f10>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99f50>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99f90>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99050>, u'Mr'), (<django.db.models.fields.CharField object at 0x7fcdcde991d0>, u'bruno'), (<django.db.models.fields.CharField object at 0x7fcdcde992d0>, u'desachy'), (<django.db.models.fields.CharField object at 0x7fcdcde993d0>, u'bruno.desachy@gmail.com'), (<django.db.models.fields.related.ForeignKey object at 0x7fcdcde994d0>, 1), (<django.db.models.fields.related.ForeignKey object at 0x7fcdcde995d0>, 9), (<django.db.models.fields.NullBooleanField object at 0x7fcdcde99710>, True), (<django.db.models.fields.NullBooleanField object at 0x7fcdcde99790>, None)]

* /usr/lib/pymodules/python2.6/django/db/models/manager.py in _insert

   188. def using(self, *args, **kwargs):

   189. return self.get_query_set().using(*args, **kwargs)

   190.

   191. def exists(self, *args, **kwargs):

   192. return self.get_query_set().exists(*args, **kwargs)

   193.

   194. def _insert(self, values, **kwargs):

   195. return insert_query(self.model, values, **kwargs) ...

   196.

   197. def _update(self, values, **kwargs):

   198. return self.get_query_set()._update(values, **kwargs)

   199.

   200. def raw(self, raw_query, params=None, *args, **kwargs):

   201. return RawQuerySet(raw_query=raw_query, model=self.model, params=params, using=self._db, *args, **kwargs)

  ▶ Local vars

  Variable  Value

  kwargs    

  {'return_id': True, 'using': 'default'}

  self  

  <django.db.models.manager.Manager object at 0x7fcdcde9b050>

  values    

  [(<django.db.models.fields.related.ForeignKey object at 0x7fcdcde99c90>, 1), (<django.db.models.fields.TextField object at 0x7fcdcde99e10>, None), (<django.db.models.fields.TextField object at 0x7fcdcde99e50>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99e90>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99ed0>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99f10>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99f50>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99f90>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99050>, u'Mr'), (<django.db.models.fields.CharField object at 0x7fcdcde991d0>, u'bruno'), (<django.db.models.fields.CharField object at 0x7fcdcde992d0>, u'desachy'), (<django.db.models.fields.CharField object at 0x7fcdcde993d0>, u'bruno.desachy@gmail.com'), (<django.db.models.fields.related.ForeignKey object at 0x7fcdcde994d0>, 1), (<django.db.models.fields.related.ForeignKey object at 0x7fcdcde995d0>, 9), (<django.db.models.fields.NullBooleanField object at 0x7fcdcde99710>, True), (<django.db.models.fields.NullBooleanField object at 0x7fcdcde99790>, None)]

* /usr/lib/pymodules/python2.6/django/db/models/query.py in insert_query

  1472. """

  1473. Inserts a new record for the given model. This provides an interface to

  1474. the InsertQuery class and is how Model.save() is implemented. It is not

  1475. part of the public API.

  1476. """

  1477. query = sql.InsertQuery(model)

  1478. query.insert_values(values, raw_values)

  1479. return query.get_compiler(using=using).execute_sql(return_id) ...

  ▶ Local vars

  Variable  Value

  model     

  <class 'ishtar.furnitures.models.Person'>

  query     

  <django.db.models.sql.subqueries.InsertQuery object at 0x7fcdce8667d0>

  raw_values    

  False

  return_id     

  True

  using     

  'default'

  values    

  [(<django.db.models.fields.related.ForeignKey object at 0x7fcdcde99c90>, 1), (<django.db.models.fields.TextField object at 0x7fcdcde99e10>, None), (<django.db.models.fields.TextField object at 0x7fcdcde99e50>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99e90>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99ed0>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99f10>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99f50>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99f90>, None), (<django.db.models.fields.CharField object at 0x7fcdcde99050>, u'Mr'), (<django.db.models.fields.CharField object at 0x7fcdcde991d0>, u'bruno'), (<django.db.models.fields.CharField object at 0x7fcdcde992d0>, u'desachy'), (<django.db.models.fields.CharField object at 0x7fcdcde993d0>, u'bruno.desachy@gmail.com'), (<django.db.models.fields.related.ForeignKey object at 0x7fcdcde994d0>, 1), (<django.db.models.fields.related.ForeignKey object at 0x7fcdcde995d0>, 9), (<django.db.models.fields.NullBooleanField object at 0x7fcdcde99710>, True), (<django.db.models.fields.NullBooleanField object at 0x7fcdcde99790>, None)]

* /usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py in execute_sql

   776. r_fmt, r_params = self.connection.ops.return_insert_id()

   777. result.append(r_fmt % col)

   778. params = params + r_params

   779. return ' '.join(result), params

   780.

   781. def execute_sql(self, return_id=False):

   782. self.return_id = return_id

   783. cursor = super(SQLInsertCompiler, self).execute_sql(None) ...

   784. if not (return_id and cursor):

   785. return

   786. if self.connection.features.can_return_id_from_insert:

   787. return self.connection.ops.fetch_returned_insert_id(cursor)

   788. return self.connection.ops.last_insert_id(cursor,

   789. self.query.model._meta.db_table, self.query.model._meta.pk.column)

  ▶ Local vars

  Variable  Value

  return_id     

  True

  self  

  <django.contrib.gis.db.models.sql.compiler.SQLInsertCompiler object at 0x7fcdce5ce110>

* /usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py in execute_sql

   720. except EmptyResultSet:

   721. if result_type == MULTI:

   722. return empty_iter()

   723. else:

   724. return

   725.

   726. cursor = self.connection.cursor()

   727. cursor.execute(sql, params) ...

   728.

   729. if not result_type:

   730. return cursor

   731. if result_type == SINGLE:

   732. if self.query.ordering_aliases:

   733. return cursor.fetchone()[:-len(self.query.ordering_aliases)]

  ▶ Local vars

  Variable  Value

  cursor    

  <django.db.backends.util.CursorDebugWrapper object at 0x7fcdce878cd0>

  params    

  (1, None, None, None, None, None, None, None, u'Mr', u'bruno', u'desachy', u'bruno.desachy@gmail.com', 1, 9, True, None)

  result_type   

  None

  self  

  <django.contrib.gis.db.models.sql.compiler.SQLInsertCompiler object at 0x7fcdce5ce110>

  sql   

  'INSERT INTO "furnitures_person" ("history_modifier_id", "address", "address_complement", "postal_code", "town", "country", "phone", "mobile_phone", "title", "surname", "name", "email", "person_type_id", "attached_to_id", "is_author", "in_charge_storage") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)'

* /usr/lib/pymodules/python2.6/django/db/backends/util.py in execute

     8. def __init__(self, cursor, db):

     9. self.cursor = cursor

    10. self.db = db # Instance of a BaseDatabaseWrapper subclass

    11.

    12. def execute(self, sql, params=()):

    13. start = time()

    14. try:

    15. return self.cursor.execute(sql, params) ...

    16. finally:

    17. stop = time()

    18. sql = self.db.ops.last_executed_query(self.cursor, sql, params)

    19. self.db.queries.append({

    20. 'sql': sql,

    21. 'time': "%.3f" % (stop - start),

  ▶ Local vars

  Variable  Value

  params    

  (1, None, None, None, None, None, None, None, u'Mr', u'bruno', u'desachy', u'bruno.desachy@gmail.com', 1, 9, True, None)

  self  

  <django.db.backends.util.CursorDebugWrapper object at 0x7fcdce878cd0>

  sql   

  'INSERT INTO "furnitures_person" ("history_modifier_id", "address", "address_complement", "postal_code", "town", "country", "phone", "mobile_phone", "title", "surname", "name", "email", "person_type_id", "attached_to_id", "is_author", "in_charge_storage") VALUES (1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, E\'Mr\', E\'bruno\', E\'desachy\', E\'bruno.desachy@gmail.com\', 1, 9, true, NULL)'

  start     

  1295386187.874177

  stop  

  1295386187.8770249

* /usr/lib/pymodules/python2.6/django/db/backends/postgresql_psycopg2/base.py in execute

    37. """

    38.

    39. def __init__(self, cursor):

    40. self.cursor = cursor

    41.

    42. def execute(self, query, args=None):

    43. try:

    44. return self.cursor.execute(query, args) ...

    45. except Database.IntegrityError, e:

    46. raise utils.IntegrityError, utils.IntegrityError(*tuple(e)), sys.exc_info()[2]

    47. except Database.DatabaseError, e:

    48. raise utils.DatabaseError, utils.DatabaseError(*tuple(e)), sys.exc_info()[2]

    49.

    50. def executemany(self, query, args):

  ▶ Local vars 
Actions #1

Updated by Yann Le Jeune almost 14 years ago

That BUG exist both in Django admin and in Ishtar admin.

Actions #2

Updated by Étienne Loks almost 14 years ago

  • % Done changed from 0 to 100
  • Status changed from Nouveau to Fermé
Actions #3

Updated by Étienne Loks over 13 years ago

  • Target version set to 1.0
Actions

Also available in: Atom PDF