try to avoid ValueError because of erroneous date
This commit is contained in:
parent
8190d56286
commit
c7059e4f52
1 changed files with 5 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (c) 2013 Helmut Merz helmutm@cy55.de
|
||||
# Copyright (c) 2016 Helmut Merz helmutm@cy55.de
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -315,7 +315,10 @@ class DateFieldInstance(NumberFieldInstance):
|
|||
if langInfo:
|
||||
locale = locales.getLocale(langInfo.language)
|
||||
fmt = locale.dates.getFormatter(*format)
|
||||
return fmt.format(value)
|
||||
try:
|
||||
return fmt.format(value)
|
||||
except ValueError:
|
||||
return str(value)
|
||||
return str(value)
|
||||
|
||||
def unmarshall(self, value):
|
||||
|
|
Loading…
Add table
Reference in a new issue