def home() -> str: """The queue administration home page.""" return render_admin( 'home.html', num_inquiries=Inquiry.get_num_unresolved(), latest_inquiry=Inquiry.get_current_or_latest(), current_inquiry=Inquiry.get_current(), ttr=g.queue.ttr(), earliest_request=Inquiry.get_earliest(), locations=Inquiry.get_unresolved( str2lst(g.queue.setting('locations').value), 'location'))
def help_latest(location: str=None, category: str=None) -> str: """Automatically select next inquiry.""" if g.queue.show_inquiry_types() and not category: categories = Inquiry.get_categories_unresolved(location=location) if len(categories) > 1: return render_admin( 'categories.html', title='Request Type', location=location, categories=categories) inquiry = Inquiry.get_current_or_latest( location=location, category=category) Inquiry.maybe_unlock_delayed() if not inquiry: return redirect(url_for('admin.home', notification=NOTIF_HELP_DONE)) inquiry.lock().link(current_user()) return redirect(url_for( 'admin.help_inquiry', id=inquiry.id, location=location))