PhlexPlexico / get5-web

[END OF LIFE] Webpanel for servers using the get5 CS:GO server plugin
GNU General Public License v3.0
21 stars 10 forks source link

[BUG] Error in Team Leaderboard URL #145

Closed xe1os closed 5 years ago

xe1os commented 5 years ago

Describe the bug Error while viewing Team Leaderboard (/leaderboard)

Which Build Both

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Leaderboards'
  2. Click on 'Team Leaderboard'
  3. See error 'Sorry, unexpected error: 'NoneType' object has no attribute 'id'

Expected behavior Should show the team leaderboard for all matches irrespective of season.

Additional context We should be able to see top team across all matches, like we have player leaderboard for all matches (/leaderboard/players)

PhlexPlexico commented 5 years ago

This is most likely do to an error in your data, as seen in issue #134. Please provide a log file when the issue currently happens, as it is far easier to debug. Thanks!

xe1os commented 5 years ago

This is most likely do to an error in your data, as seen in issue #134. Please provide a log file when the issue currently happens, as it is far easier to debug. Thanks!

get5.log

get5.log.2019-10-11.log

@PhlexPlexico thank you

PhlexPlexico commented 5 years ago

You currently have matches that are cancelled, or a match that has been completed with no winner. dTeamStandings[winningTeam.name]['teamid'] = winningTeam.id AttributeError: 'NoneType' object has no attribute 'id'

Please run select * from `match` where winner is NULL and update those records accordingly.

xe1os commented 5 years ago

You currently have matches that are cancelled, or a match that has been completed with no winner. dTeamStandings[winningTeam.name]['teamid'] = winningTeam.id AttributeError: 'NoneType' object has no attribute 'id'

Please run select * from `match` where winner is NULL and update those records accordingly.

@PhlexPlexico i have updated the values for records with NULL information in the database using your query select * from `match` where winner is NULL.

Still getting the same error :(

PhlexPlexico commented 5 years ago

Can you post your latest log again after causing this error? It seems you have some data problems in your database that's causing this error, as I cannot reproduce.

PhlexPlexico commented 5 years ago

Also, would you mind running select * from map_stats where winner is NULL? It's possible the winners were never set in the map stats.

mrc4tt commented 5 years ago

Aha. it's because, if you are setting "forfeit" to the team (without connecting to gameserver e.g) it will say that.

Example from my database: screen

PhlexPlexico commented 5 years ago

Uno momento, making one fix for this as well within the query.

PhlexPlexico commented 5 years ago

https://github.com/PhlexPlexico/get5-web/commit/6ece3048287c4240693ebdb7f0aa6cfa42286b57 Should fix that now.

mrc4tt commented 5 years ago

6ece304 Should fix that now.

I can confirm it works! ;) /close this =D

PhlexPlexico commented 5 years ago

Latest push to master will also show winner in the map stats as well.