Very very minor refactor, why even do this

This commit is contained in:
Peter Stockings
2023-10-20 18:45:21 +11:00
parent f801c3c615
commit 18ac5d3fbc

5
app.py
View File

@@ -545,9 +545,6 @@ def generate_calendar_monthly_view(workouts, selected_date):
""" """
Generate a monthly calendar view of the workouts. Generate a monthly calendar view of the workouts.
""" """
def get_workout_for_date(workout_lookup, date):
return workout_lookup.get(date)
start_date, end_date = get_month_bounds(selected_date) start_date, end_date = get_month_bounds(selected_date)
# Build a lookup dictionary for faster access # Build a lookup dictionary for faster access
@@ -560,7 +557,7 @@ def generate_calendar_monthly_view(workouts, selected_date):
'date': day, 'date': day,
'day_of_month': day.day, 'day_of_month': day.day,
'is_workout': day in workout_lookup, 'is_workout': day in workout_lookup,
'workout': get_workout_for_date(workout_lookup, day), 'workout': workout_lookup.get(day),
'is_current_date': day == current_date, 'is_current_date': day == current_date,
'is_current_month': day.month == selected_date.month and day.year == selected_date.year 'is_current_month': day.month == selected_date.month and day.year == selected_date.year
} }