Browse Source

removing unnecessary randomisation

joel
Simon Bowie 1 year ago
parent
commit
fff98119d5
3 changed files with 3 additions and 3 deletions
  1. +1
    -1
      web/app/book.py
  2. +1
    -1
      web/app/practice.py
  3. +1
    -1
      web/app/tool.py

+ 1
- 1
web/app/book.py View File

intro_text = markdown.markdown(intro_text) intro_text = markdown.markdown(intro_text)
view = request.args.get('view') view = request.args.get('view')
resource_type = 'book' resource_type = 'book'
books_query = Resource.query.filter_by(type=resource_type).order_by(func.random())
books_query = Resource.query.filter_by(type=resource_type)
for key in request.args.keys(): for key in request.args.keys():
if key != 'view': if key != 'view':
if (key == 'practice' and request.args.get(key) != ''): if (key == 'practice' and request.args.get(key) != ''):

+ 1
- 1
web/app/practice.py View File

intro_text = f.read() intro_text = f.read()
intro_text = markdown.markdown(intro_text) intro_text = markdown.markdown(intro_text)
view = request.args.get('view') view = request.args.get('view')
practices = Resource.query.filter_by(type='practice').order_by(func.random())
practices = Resource.query.filter_by(type='practice')
# temporarily removing incomplete practices from main list # temporarily removing incomplete practices from main list
practices = Resource.query.filter( practices = Resource.query.filter(
or_( or_(

+ 1
- 1
web/app/tool.py View File

intro_text = markdown.markdown(intro_text) intro_text = markdown.markdown(intro_text)
view = request.args.get('view') view = request.args.get('view')
resource_type = 'tool' resource_type = 'tool'
tools_query = Resource.query.filter_by(type=resource_type).order_by(func.random())
tools_query = Resource.query.filter_by(type=resource_type)
for key in request.args.keys(): for key in request.args.keys():
if key != 'view': if key != 'view':
if (key == 'practice' and request.args.get(key) != ''): if (key == 'practice' and request.args.get(key) != ''):

Loading…
Cancel
Save