1.1 --- a/imiptools/handlers/scheduling/quota.py Sun Jun 04 18:28:18 2017 +0200
1.2 +++ b/imiptools/handlers/scheduling/quota.py Sun Jun 04 20:15:44 2017 +0200
1.3 @@ -187,7 +187,7 @@
1.4
1.5 total = timedelta(0)
1.6
1.7 - for period in handler.get_periods(handler.obj):
1.8 + for period in handler.get_periods(handler.obj, future_only=True):
1.9 duration = period.get_duration()
1.10
1.11 # Decline events whose period durations are endless.
1.12 @@ -211,7 +211,7 @@
1.13 if handler.obj.possibly_recurring_indefinitely():
1.14 return None
1.15
1.16 - periods = handler.get_periods(handler.obj)
1.17 + periods = handler.get_periods(handler.obj, future_only=True)
1.18 return periods and to_utc_datetime(periods[-1].get_end_point()) or None
1.19
1.20 def _get_usage(entries):
1.21 @@ -282,7 +282,7 @@
1.22 # Check the event periods against the quota's consolidated record of the
1.23 # organiser's reservations.
1.24
1.25 - periods = handler.get_periods(handler.obj)
1.26 + periods = handler.get_periods(handler.obj, future_only=True)
1.27 freebusy = handler.get_journal().get_entries(quota, organiser)
1.28 scheduled = handler.can_schedule(freebusy, periods)
1.29