Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersSeverinsen committed Dec 16, 2024
1 parent e2a2373 commit 3d9e8fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bartenders/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion bartenders/templates/barplan.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h2 id="barplan">{% translate "Barplan" %}</h2>
<a href="?shifts_pages_per_page={{ shifts_pages_per_page }}&shifts_page={{ bartendershifts.previous_page_number }}#barplan"><i>{% bs_icon 'chevron-double-left' size='0.7em' %}</i></a>

{% if bartendershifts.number > 3 %}
<a href="?shifts_pages_per_page={{ shifts_pages_per_page }}shifts_page=1#barplan">1</a>
<a href="?shifts_pages_per_page={{ shifts_pages_per_page }}&shifts_page=1#barplan">1</a>
{% if bartendershifts.number > 4 %}
<span>...</span>
{% endif %}
Expand Down
2 changes: 2 additions & 0 deletions bartenders/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3d9e8fa

Please sign in to comment.