diff --git a/bartenders/models.py b/bartenders/models.py index 4633545..465cc0f 100644 --- a/bartenders/models.py +++ b/bartenders/models.py @@ -508,8 +508,8 @@ def is_with_bartender(self, bartender): def compare_to_current_week(self): date = timezone.now().date() - less_than_week = self.start_date < date - greater_than_week = self.end_date > date - datetime.timedelta(1) + less_than_week = self.start_date <= date + greater_than_week = self.end_date >= date if less_than_week and greater_than_week: return 0 elif less_than_week: diff --git a/bartenders/templates/barplan.html b/bartenders/templates/barplan.html index 95b58be..352dbc9 100644 --- a/bartenders/templates/barplan.html +++ b/bartenders/templates/barplan.html @@ -53,7 +53,7 @@

{% translate "Barplan" %}

{% bs_icon 'chevron-double-left' size='0.7em' %} {% if bartendershifts.number > 3 %} - 1 + 1 {% if bartendershifts.number > 4 %} ... {% endif %} diff --git a/bartenders/views.py b/bartenders/views.py index a79ea3d..1df1fb9 100644 --- a/bartenders/views.py +++ b/bartenders/views.py @@ -94,6 +94,7 @@ def get_context_data(self, **kwargs): not bartendershifts_pages_per_page or bartendershifts_pages_per_page == "0" or bartendershifts_pages_per_page == "" + or not bartendershifts_pages_per_page.isdigit() ): bartendershifts_pages_per_page = default_shifts_pages_per_page context["shifts_pages_per_page"] = bartendershifts_pages_per_page @@ -103,6 +104,7 @@ def get_context_data(self, **kwargs): not depositshifts_pages_per_page or depositshifts_pages_per_page == "0" or depositshifts_pages_per_page == "" + or not depositshifts_pages_per_page.isdigit() ): depositshifts_pages_per_page = default_deposit_pages_per_page context["deposit_pages_per_page"] = depositshifts_pages_per_page