jcazevedo / pawned

Also known as “I can’t believe it’s not an online chess club manager.”
2 stars 0 forks source link

Insert match with date prior to player criation #21

Closed maharifu closed 12 years ago

maharifu commented 12 years ago

When inserting a match with a date that is before the player was created, boom goes the dynamite with an error in 'update_ratings', as it tries to get the value of a rating that does not exist.

jcazevedo commented 12 years ago

I can take this. I see two alternatives for this:

  1. Disallow the creation of matches prior to the registration date of each of the players.
  2. Push the initial rating of the player to before the match.

I prefer the latter. It is not hard to implement and, as far as I can tell, there won't be any inconsistencies in the ratings.

jcazevedo commented 12 years ago

I'm having a different approach after all. Since the initial rating date is not that important, I'm setting it to the epoch time.