Skip to content

Commit

Permalink
Merge pull request #119 from EarthSchlange/add_unicode_check_for_zero…
Browse files Browse the repository at this point in the history
…_dates

Added unicode check for game dates.
  • Loading branch information
Michael Hiiva authored Sep 3, 2020
2 parents bee5032 + c3bd443 commit ba12bab
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion agagd/agagd_core/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,15 @@ def member_detail(request, member_id):
t_dat['tournament'] = game.tournament_code
t_dat['won'] = t_dat.get('won', 0)
t_dat['lost'] = t_dat.get('lost', 0)
t_dat['date'] = t_dat.get('date', game.game_date)

# Set default game_date to None
game_date = None

# Check for 0000-00-00 dates
if game.game_date != u'0000-00-00':
game_date = game.game_date

t_dat['date'] = t_dat.get('date', game_date)

op = game.player_other_than(player)
opp_dat = opponent_data.get(op, {})
Expand Down

0 comments on commit ba12bab

Please sign in to comment.