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,7 +40,13 @@ class BatchIDFieldRenderer(fa.FieldRenderer):
|
||||||
Renderer for batch ID fields.
|
Renderer for batch ID fields.
|
||||||
"""
|
"""
|
||||||
def render_readonly(self, **kwargs):
|
def render_readonly(self, **kwargs):
|
||||||
|
try:
|
||||||
batch_id = self.raw_value
|
batch_id = self.raw_value
|
||||||
|
except AttributeError:
|
||||||
|
# this can happen when creating a new batch, b/c the default value
|
||||||
|
# comes from a sequence
|
||||||
|
pass
|
||||||
|
else:
|
||||||
if batch_id:
|
if batch_id:
|
||||||
return '{:08d}'.format(batch_id)
|
return '{:08d}'.format(batch_id)
|
||||||
return ''
|
return ''
|
||||||
|
|
Loading…
Reference in a new issue