Add support to set degree of line of best fit for exercise progress graphs in custom view
This commit is contained in:
3
app.py
3
app.py
@@ -404,11 +404,12 @@ def get_exercise_progress_for_user(person_id, exercise_id):
|
||||
max_date = convert_str_to_date(request.args.get(
|
||||
'max_date'), '%Y-%m-%d')
|
||||
epoch = request.args.get('epoch', default='All')
|
||||
degree = request.args.get('degree', type=int, default=1)
|
||||
|
||||
if epoch == 'Custom' and (min_date is None or max_date is None):
|
||||
(min_date, max_date) = db.get_exercise_earliest_and_latest_dates(person_id, exercise_id)
|
||||
|
||||
exercise_progress = db.get_exercise_progress_for_user(person_id, exercise_id, min_date, max_date, epoch)
|
||||
exercise_progress = db.get_exercise_progress_for_user(person_id, exercise_id, min_date, max_date, epoch, degree=degree)
|
||||
|
||||
if not exercise_progress:
|
||||
abort(404)
|
||||
|
||||
Reference in New Issue
Block a user