From 1a50f249f3acc2b2dc4aa4af2699bc42ad0648b7 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Tue, 8 Jun 2021 16:42:12 +0530 Subject: [PATCH] update logic from 18+ to 18-44 - Issue #218 --- src/utils.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/utils.py b/src/utils.py index e3b996d6..ba3b4dee 100644 --- a/src/utils.py +++ b/src/utils.py @@ -41,18 +41,21 @@ def viable_options(resp, minimum_slots, min_age_booking, fee_type, dose): if (availability >= minimum_slots) \ and (session['min_age_limit'] <= min_age_booking)\ and (center['fee_type'] in fee_type): - out = { - 'name': center['name'], - 'district': center['district_name'], - 'pincode': center['pincode'], - 'center_id': center['center_id'], - 'available': availability, - 'date': session['date'], - 'slots': session['slots'], - 'session_id': session['session_id'] - } - options.append(out) - + if session['min_age_limit'] != 18 or (session['min_age_limit'] == 18 and min_age_booking <= 44): + out = { + 'name': center['name'], + 'district': center['district_name'], + 'pincode': center['pincode'], + 'center_id': center['center_id'], + 'available': availability, + 'date': session['date'], + 'slots': session['slots'], + 'session_id': session['session_id'] + } + options.append(out) + + else: + pass else: pass else: