|
@@ -56,7 +56,7 @@ def trend_internal(conn: Connection[TupleRow], path: str, query: FormsDict):
|
|
k: get_query_param(*_filter[k])
|
|
k: get_query_param(*_filter[k])
|
|
for k in sorted(_filter) if k not in ('organic', 'unit') and _filter[k]
|
|
for k in sorted(_filter) if k not in ('organic', 'unit') and _filter[k]
|
|
}
|
|
}
|
|
- unit = fields['unit'] = fields['unit'] or 'kg' if 'unit' in fields else 'kg'
|
|
|
|
|
|
+ unit = fields['unit'] = query.unit or 'kg'
|
|
fields['organic'] = BOOLEAN.get(query.organic, None)
|
|
fields['organic'] = BOOLEAN.get(query.organic, None)
|
|
if unit and unit not in ALL_UNITS:
|
|
if unit and unit not in ALL_UNITS:
|
|
yield abort(400, f"Unsupported unit {unit}")
|
|
yield abort(400, f"Unsupported unit {unit}")
|