* Kommentare wenn Dan/Kyu Punktabzüge verringert werden um nicht unter
0 zu fallen. * Neue Middleware die REMOTE_IP aus dem X-Forward-For Header setzt. Damit funktioniert das Kommentarsystem nun auch hinter nginx.
This commit is contained in:
@@ -566,11 +566,15 @@ class KyuDanRanking(models.Model):
|
||||
if self.dan:
|
||||
# Only substract so much points that player has 0 Points:
|
||||
if self.dan_points + hanchan.dan_points < 0:
|
||||
hanchan.player_comment = 'Spieler unterschreitet 0 Punkte.' \
|
||||
'(Original {} Punkte)'.format(hanchan.dan_points)
|
||||
hanchan.dan_points -= (self.dan_points + hanchan.dan_points)
|
||||
self.dan_points += hanchan.dan_points
|
||||
else:
|
||||
# Only substract so much points that player has 0 Points:
|
||||
if self.kyu_points + hanchan.kyu_points < 0:
|
||||
hanchan.player_comment = 'Spieler unterschreitet 0 Punkte.' \
|
||||
'(Original {} Punkte)'.format(hanchan.kyu_points)
|
||||
hanchan.kyu_points -= (self.kyu_points + hanchan.kyu_points)
|
||||
self.kyu_points += hanchan.kyu_points
|
||||
|
||||
|
||||
Reference in New Issue
Block a user