Project

General

Profile

Bug #10742

Crash à l'import d'un formulaire quand une date minimale est renseignée

Added by Pierre Cros almost 5 years ago. Updated over 4 years ago.

Status:
Fermé
Priority:
Normal
Target version:
Start date:
27 Apr 2016
Due date:
% Done:

0%

Estimated time:
Patch proposed:
Yes
Planning:

Description

Vu sur ce champ : https://demarches.vincennes.fr/backoffice/forms/34/fields/8/

Quand la date minimale est renseigné, qu'on exporte/importe le formulaire, ça crashe à l'import. Si on supprime la date, ça passe.


Files

Associated revisions

Revision 00d56c14 (diff)
Added by Frédéric Péters almost 5 years ago

fields: be lax on date(/time) format of date field settings (#10742)

History

#2

Updated by Pierre Cros almost 5 years ago

Il me semble que c'est cette trace: https://sentry.entrouvert.org/sentry/r
ecette/issues/133/

Yep (mais j'en ai faite plusieurs en fait, j'ai testé à l'aveugle avant de
penser à activer les traces ce qui m'a permis de comprendre).

Pierre

#3

Updated by Frédéric Péters almost 5 years ago

ValueError: time data '01/01/1900' does not match format '%Y-%m-%d'
  File "quixote/publish.py", line 275, in process_request
    output = self.try_publish(request)
  File "wcs/publisher.py", line 227, in try_publish
    return QommonPublisher.try_publish(self, request)
  File "qommon/publisher.py", line 622, in try_publish
    return Publisher.try_publish(self, request)
  File "quixote/publish.py", line 253, in try_publish
    output = self.root_directory._q_traverse(components)
  File "modules/root.py", line 829, in _q_traverse
    return Directory._q_traverse(self, path)
  File "quixote/directory.py", line 63, in _q_traverse
    return obj._q_traverse(path)
  File "wcs/backoffice/root.py", line 85, in _q_traverse
    return super(RootDirectory, self)._q_traverse(path)
  File "quixote/directory.py", line 91, in _q_traverse
    return super(AccessControlled, self)._q_traverse(path)
  File "quixote/directory.py", line 63, in _q_traverse
    return obj._q_traverse(path)
  File "quixote/directory.py", line 91, in _q_traverse
    return super(AccessControlled, self)._q_traverse(path)
  File "quixote/directory.py", line 63, in _q_traverse
    return obj._q_traverse(path)
  File "quixote/directory.py", line 67, in _q_traverse
    return obj()
  File "wcs/admin/forms.py", line 486, in _q_index
    r += self.get_preview()
  File "wcs/admin/forms.py", line 749, in get_preview
    field.add_to_form(form)
  File "wcs/fields.py", line 926, in add_to_form
    WidgetField.add_to_form(self, form, value=value)
  File "wcs/fields.py", line 341, in add_to_form
    form.add(self.widget_class, 'f%s' % self.id, title=self.label, hint=hint, **kwargs)
  File "qommon/form.py", line 285, in add
    QuixoteForm.add(self, widget_class, name, *args, **kwargs)
  File "quixote/form/form.py", line 234, in add
    widget = widget_class(name, *args, **kwargs)
  File "wcs/qommon/form.py", line 842, in __init__
    self.minimum_date = time.strptime(kwargs.get('minimum_date'), misc.date_format())[:3]
  File "python2.7/_strptime.py", line 467, in _strptime_time
    return _strptime(data_string, format)[0]
  File "python2.7/_strptime.py", line 325, in _strptime
    (data_string, format))

(pas critique du tout ici, mais sur les problèmes d'import, ça peut aussi être utile d'attacher le fichier qui pose problème).

#4

Updated by Frédéric Péters almost 5 years ago

#5

Updated by Thomas Noël almost 5 years ago

Ack

#6

Updated by Thomas Noël almost 5 years ago

  • Target version set to v1.42
#7

Updated by Frédéric Péters almost 5 years ago

  • Status changed from En cours to Résolu (à déployer)
commit 00d56c1424e36df11ada11cce6216ffcb19ceedd
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Thu Apr 28 18:14:08 2016 +0200

    fields: be lax on date(/time) format of date field settings (#10742)
#8

Updated by Frédéric Péters over 4 years ago

  • Status changed from Résolu (à déployer) to Fermé

Also available in: Atom PDF