3
0
Fork 0

fix: show proper batch status text, from enum

This commit is contained in:
Lance Edgar 2026-01-02 19:22:41 -06:00
parent cbfa7f652f
commit fa2a90c9cc

View file

@ -2,7 +2,7 @@
################################################################################ ################################################################################
# #
# wuttaweb -- Web App for Wutta Framework # wuttaweb -- Web App for Wutta Framework
# Copyright © 2024-2025 Lance Edgar # Copyright © 2024-2026 Lance Edgar
# #
# This file is part of Wutta Framework. # This file is part of Wutta Framework.
# #
@ -32,7 +32,7 @@ import markdown
from sqlalchemy import orm from sqlalchemy import orm
from wuttaweb.views import MasterView from wuttaweb.views import MasterView
from wuttaweb.forms.schema import UserRef from wuttaweb.forms.schema import UserRef, WuttaDictEnum
from wuttaweb.forms.widgets import BatchIdWidget from wuttaweb.forms.widgets import BatchIdWidget
@ -147,6 +147,9 @@ class BatchMasterView(MasterView):
# description # description
g.set_link("description") g.set_link("description")
# status_code
g.set_enum("status_code", self.model_class.STATUS)
def render_batch_id( # pylint: disable=empty-docstring,unused-argument def render_batch_id( # pylint: disable=empty-docstring,unused-argument
self, batch, key, value self, batch, key, value
): ):
@ -191,6 +194,7 @@ class BatchMasterView(MasterView):
if self.creating: if self.creating:
f.remove("status_code") f.remove("status_code")
else: else:
f.set_node("status_code", WuttaDictEnum(self.request, batch.STATUS))
f.set_readonly("status_code") f.set_readonly("status_code")
# created # created