Lint fix v1
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
from .game import GameSerializer, GameEventSerializer
|
||||
from .game import GameEventSerializer, GameSerializer
|
||||
|
||||
|
||||
__all__ = ["GameSerializer", "GameEventSerializer"]
|
||||
__all__ = ['GameEventSerializer', 'GameSerializer']
|
||||
|
||||
@@ -6,22 +6,22 @@ from game.models import Game, GameEvent, GameStatuses
|
||||
class GameSerializer(serializers.ModelSerializer):
|
||||
def to_representation(self, instance):
|
||||
response = super().to_representation(instance)
|
||||
if not response["status"] == GameStatuses.FINISHED:
|
||||
del response["board"]
|
||||
if not response['status'] == GameStatuses.FINISHED:
|
||||
del response['board']
|
||||
|
||||
return response
|
||||
|
||||
class Meta:
|
||||
model = Game
|
||||
fields = "__all__"
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
class GameEventSerializer(serializers.ModelSerializer):
|
||||
def to_representation(self, instance):
|
||||
response = super().to_representation(instance)
|
||||
response["active_game"] = GameSerializer(instance.game).data
|
||||
response['active_game'] = GameSerializer(instance.game).data
|
||||
return response
|
||||
|
||||
class Meta:
|
||||
model = GameEvent
|
||||
fields = "__all__"
|
||||
fields = '__all__'
|
||||
|
||||
Reference in New Issue
Block a user