Commit 9dfe1ca4 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

simplify the query building in get_sections

parent e6cf2b7f
......@@ -87,12 +87,8 @@ def get_sections(db, selector, list):
if section.category_codes:
q_cat = None
codes = section.category_codes.replace(' ','').split(',')
for code in codes:
q = db.categories.code == code
if q_cat:
q_cat = (q_cat) | (q)
q_cat = q
if codes:
q_cat = db.categories.code.belongs(codes)
query = (query) & (q_cat)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment