Compare commits

..

No commits in common. "a26f16a67e1d246ee12a7096be730cb8ba97c5ea" and "8fc9851e2122cb959ff9e4673a506cb3e282e56a" have entirely different histories.

2 changed files with 4 additions and 16 deletions

View file

@ -667,17 +667,10 @@ class AssetRefsWidget(Widget):
readonly = kw.get("readonly", self.readonly)
if readonly:
assets = []
for uuid in cstruct or []:
if asset := session.get(model.Asset, uuid):
assets.append(asset)
assets.sort(key=lambda asset: asset.asset_name)
html = []
for asset in assets:
html.append(
asset = session.get(model.Asset, uuid)
assets.append(
HTML.tag(
"li",
c=tags.link_to(
@ -688,8 +681,7 @@ class AssetRefsWidget(Widget):
),
)
)
return HTML.tag("ul", c=html)
return HTML.tag("ul", c=assets)
values = kw.get("values", self.values)
if not isinstance(values, sequence_types):

View file

@ -103,7 +103,6 @@ class AssetMasterView(WuttaFarmMasterView):
row_labels = {
"message": "Log Name",
"locations": "Location",
}
row_grid_columns = [
@ -113,7 +112,7 @@ class AssetMasterView(WuttaFarmMasterView):
"message",
"log_type",
"assets",
"locations",
"location",
"quantity",
"is_group_assignment",
]
@ -447,9 +446,6 @@ class AssetMasterView(WuttaFarmMasterView):
# assets
g.set_renderer("assets", self.render_assets_for_grid)
# locations
g.set_renderer("locations", self.render_assets_for_grid)
def render_assets_for_grid(self, log, field, value):
assets = getattr(log, field)