Skip to content

Commit

Permalink
fix bug with getting current matchday if matches not parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh4kE committed Apr 8, 2017
1 parent 571bbc2 commit a386508
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/managers/site_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,6 @@ def _jump_to_transfer_page(self, matchday=None):
self.jump_to_frame(Constants.Transfer.DOWNLOAD_TRANSFERS_FROM_MATCHDAY.format(matchday.number))

def kill_browser(self):
self.browser.stop_client()
if self.browser:
self.browser.stop_client()
self.display.stop()
2 changes: 1 addition & 1 deletion core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_current():
matchday = Matchday.objects.all()[0]
finances = Finance.objects.all().order_by('matchday')
player_statistics = PlayerStatistics.objects.all().order_by('matchday')
matches = [m for m in Match.objects.all().order_by('matchday') if not m.is_in_future]
matches = [m for m in Match.objects.filter(matchday__season__number__gte=matchday.season.number).order_by('matchday') if not m.is_in_future]
if finances.count() > 0 and finances[0].matchday.number < matchday.number:
matchday = finances[0].matchday
if player_statistics.count() > 0 and player_statistics[0].matchday.number > matchday.number:
Expand Down

0 comments on commit a386508

Please sign in to comment.