Problem in configuration
sea-kg opened this issue · comments
Evgenii Sopov commented
$ python3 main.py scoreboard
* Running on http://0.0.0.0:9000/ (Press CTRL+C to quit)
[2016-07-19 23:20:32,076] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/home/sea-kg/.local/lib/python3.5/site-packages/flask/app.py", line 1988, in wsgi_app
response = self.full_dispatch_request()
File "/home/sea-kg/.local/lib/python3.5/site-packages/flask/app.py", line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/sea-kg/.local/lib/python3.5/site-packages/flask/app.py", line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/sea-kg/.local/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/home/sea-kg/.local/lib/python3.5/site-packages/flask/app.py", line 1639, in full_dispatch_request
rv = self.dispatch_request()
File "/home/sea-kg/.local/lib/python3.5/site-packages/flask/app.py", line 1625, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/sea-kg/develop/ctfight/ctf-attack-defense.git/classes/scoreboard.py", line 51, in index
'own': item['team']['_id'] == visitor_team['_id'],
TypeError: 'NoneType' object is not subscriptable
127.0.0.1 - - [19/Jul/2016 23:20:32] "GET / HTTP/1.1" 500 -
Config:
- team1_name = Some team 1
- team1_network = 10.53.16.1
- team1_host = 10.53.16.2
- team1_logo = http://localhost/images/team1.jpg
Evgenii Sopov commented
Fixed
visitor_team = self.db.teams.find_one({'host': request.remote_addr})
if visitor_team == None:
visitor_team = {'_id': ''}