Fix bug in batch ID field renderer, when displayed for new batch
Hopefully this is a good idea..
This commit is contained in:
parent
1327b886fc
commit
4757a56002
|
@ -40,9 +40,15 @@ class BatchIDFieldRenderer(fa.FieldRenderer):
|
||||||
Renderer for batch ID fields.
|
Renderer for batch ID fields.
|
||||||
"""
|
"""
|
||||||
def render_readonly(self, **kwargs):
|
def render_readonly(self, **kwargs):
|
||||||
batch_id = self.raw_value
|
try:
|
||||||
if batch_id:
|
batch_id = self.raw_value
|
||||||
return '{:08d}'.format(batch_id)
|
except AttributeError:
|
||||||
|
# this can happen when creating a new batch, b/c the default value
|
||||||
|
# comes from a sequence
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if batch_id:
|
||||||
|
return '{:08d}'.format(batch_id)
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue