Django Timefield(default=<TimeDelta>) gives unhelpful diagnostics
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-django (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
(Be warned, I am a novice and this may be a novice mistake):
I mistakenly added a TimeField instead of a DurationField to my model. I was forced to give it a default value and chose TimeDelta(
I'm hoping that this lack of diagnostics could be improved, to at least point to the database column that caused the problem?
Thanks in advance for all the good stuff you do :-)
Simon Lambourn.
Output from manage.py migrate:
Operations to perform:
Apply all migrations: admin, auth, contenttypes, kitten, sessions
Running migrations:
Applying kitten.
File "manage.py", line 22, in <module>
execute_
File "/usr/lib/
utility.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
output = self.handle(*args, **options)
File "/usr/lib/
fake_
File "/usr/lib/
state = self._migrate_
File "/usr/lib/
state = self.apply_
File "/usr/lib/
state = migration.
File "/usr/lib/
operation.
File "/usr/lib/
field,
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
default = field.get_
File "/usr/lib/
prepared=False)
File "/usr/lib/
value = self.get_
File "/usr/lib/
return self.to_
File "/usr/lib/
parsed = parse_time(value)
File "/usr/lib/
match = time_re.
TypeError: expected string or bytes-like object
ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: python3-django 1:1.11.
ProcVersionSign
Uname: Linux 5.3.0-46-generic x86_64
ApportVersion: 2.20.11-0ubuntu8.8
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Tue Apr 28 09:59:25 2020
PackageArchitec
SourcePackage: python-django
UpgradeStatus: Upgraded to eoan on 2019-10-23 (187 days ago)
Local Configuration Issue
Thank you for taking the time to file a bug report.
Since it seems likely to me that this is a local configuration problem,
rather than a bug in Ubuntu, I am marking this bug as 'Invalid'.
However, if you believe that this is really a bug in Ubuntu, then we would
be grateful if you would provide a more complete description of the problem
with steps to reproduce, explain why you believe this is a bug in Ubuntu
rather than a problem specific to your system, and then change the bug
status back to "New".
For local configuration issues, you can find assistance here: www.ubuntu. com/support/ community
http://