[Django] #30232: Correct the error message for the invalid DurationField

3 views
Skip to first unread message

Django

unread,
Mar 2, 2019, 9:27:27 PM3/2/19
to django-...@googlegroups.com
#30232: Correct the error message for the invalid DurationField
-------------------------------------+-------------------------------------
Reporter: Aidas | Owner: nobody
Bendoraitis |
Type: Bug | Status: new
Component: Database | Version: 2.2
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 1 |
-------------------------------------+-------------------------------------
If you enter a duration "14:00" into a duration field, it translates to
"00:14:00" which is 14 minutes.

The current error message for invalid DurationField says that this should
be the format of durations: "[DD] [HH:[MM:]]ss[.uuuuuu]". But according to
the actual behaviour, it should be: "[DD] [[HH:]MM:]ss[.uuuuuu]", because
seconds are mandatory, minutes are optional, and hours are optional if
minutes are provided.

This seems to be a mistake in all Django versions that support the
DurationField.

Also the duration fields could have a default help_text with the requested
format, because the syntax is not self-explanatory.

--
Ticket URL: <https://code.djangoproject.com/ticket/30232>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 3, 2019, 4:13:10 AM3/3/19
to django-...@googlegroups.com
#30232: Correct the error message for the invalid DurationField
-------------------------------------+-------------------------------------
Reporter: Aidas Bendoraitis | Owner: avas9366
Type: Bug | Status: assigned
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by avas9366):

* owner: nobody => avas9366
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/30232#comment:1>

Django

unread,
Mar 3, 2019, 5:03:22 AM3/3/19
to django-...@googlegroups.com
#30232: Correct the error message for the invalid DurationField
-------------------------------------+-------------------------------------
Reporter: Aidas Bendoraitis | Owner: avas9366
Type: Bug | Status: assigned
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by avas9366):

* has_patch: 0 => 1


Comment:

I have created a pull request # 11049.

--
Ticket URL: <https://code.djangoproject.com/ticket/30232#comment:2>

Django

unread,
Mar 4, 2019, 6:54:30 PM3/4/19
to django-...@googlegroups.com
#30232: Correct expected format in invalid DurationField error message

-------------------------------------+-------------------------------------
Reporter: Aidas Bendoraitis | Owner: avas9366
Type: Bug | Status: assigned
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/30232#comment:3>

Django

unread,
Mar 4, 2019, 7:26:16 PM3/4/19
to django-...@googlegroups.com
#30232: Correct expected format in invalid DurationField error message
-------------------------------------+-------------------------------------
Reporter: Aidas Bendoraitis | Owner: avas9366
Type: Bug | Status: closed

Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"9681e968ebdcd58cac99c1e60f0a6932abd4e5c9" 9681e968]:
{{{
#!CommitTicketReference repository=""
revision="9681e968ebdcd58cac99c1e60f0a6932abd4e5c9"
Fixed #30232 -- Corrected expected format in invalid DurationField error
message.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30232#comment:4>

Reply all
Reply to author
Forward
0 new messages