Opened 5 years ago

Closed 5 years ago

#30434 closed Bug (duplicate)

DurationField silently drops negative sign

Reported by: Ryan Govostes Owned by: nobody
Component: Database layer (models, ORM) Version: 2.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When a negative value, such as -00:00:05 is written to a DurationField via the admin interface, the value is silently converted to 00:00:05, dropping the negative.

There is no note in the documentation that this would be expected, and indeed it seems that #27699 was intended to support negative values for DurationFields on SQLite.

I've tried with both SQLite and PostgreSQL database backends.

Change History (2)

comment:1 by Ryan Govostes, 5 years ago

Summary: DurationField silentlyDurationField silently drops negative sign

comment:2 by Ryan Govostes, 5 years ago

Resolution: duplicate
Status: newclosed

I think this is a duplicate of #30141 which is fixed (https://github.com/django/django/pull/10999) but doesn't seem to be in the 2.2 branch yet.

Note: See TracTickets for help on using tickets.
Back to Top