Compare commits
6 Commits
v0.3.25020
...
v0.3.25020
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e0af277fe | |||
| 6795697dea | |||
| 0397465ec3 | |||
| c7ca9f9442 | |||
| 9c6db02e57 | |||
| d6cd731a2a |
@@ -45,21 +45,11 @@ jobs:
|
|||||||
--header "Authorization: Bearer $TOKEN" \
|
--header "Authorization: Bearer $TOKEN" \
|
||||||
--data '{
|
--data '{
|
||||||
"image": "docker.nexus.makecodes.dev/mines/backend",
|
"image": "docker.nexus.makecodes.dev/mines/backend",
|
||||||
"service": "nfe-vision_app",
|
"service": "mines_backend",
|
||||||
"version": "${{ github.ref_name }}",
|
"version": "${{ github.ref_name }}",
|
||||||
"pipeline": "${{ github.run_number }}",
|
"pipeline": "${{ github.run_number }}",
|
||||||
"repository": "mines/backend"
|
"repository": "mines/backend"
|
||||||
}'
|
}'
|
||||||
# curl --location --silent 'https://deployer.makecodes.dev/deploy' \
|
|
||||||
# --header 'Content-Type: application/json' \
|
|
||||||
# --header "Authorization: Bearer $TOKEN" \
|
|
||||||
# --data '{
|
|
||||||
# "image": "docker.nexus.makecodes.dev/makecodes/nfe-vision",
|
|
||||||
# "service": "nfe-vision_worker",
|
|
||||||
# "version": "${{ github.ref_name }}",
|
|
||||||
# "pipeline": "${{ github.run_number }}",
|
|
||||||
# "repository": "makecodes/nfe-vision"
|
|
||||||
# }'
|
|
||||||
env:
|
env:
|
||||||
USERNAME: ${{ secrets.SERVER_AUTH_USERNAME }}
|
USERNAME: ${{ secrets.SERVER_AUTH_USERNAME }}
|
||||||
PASSWORD: ${{ secrets.SERVER_AUTH_PASSWORD }}
|
PASSWORD: ${{ secrets.SERVER_AUTH_PASSWORD }}
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ class GameEventResource(APIView):
|
|||||||
|
|
||||||
def post(self, request, game_id):
|
def post(self, request, game_id):
|
||||||
"""Creates a new event"""
|
"""Creates a new event"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
game = Game.objects.get(pk=game_id)
|
game = Game.objects.get(pk=game_id)
|
||||||
except Game.DoesNotExist:
|
except Game.DoesNotExist:
|
||||||
|
|||||||
@@ -131,7 +131,6 @@ REST_FRAMEWORK = {
|
|||||||
'DEFAULT_RENDERER_CLASSES': ('rest_framework.renderers.JSONRenderer',),
|
'DEFAULT_RENDERER_CLASSES': ('rest_framework.renderers.JSONRenderer',),
|
||||||
}
|
}
|
||||||
|
|
||||||
if DEBUG is True:
|
|
||||||
CORS_ALLOW_ALL_ORIGINS = True
|
CORS_ALLOW_ALL_ORIGINS = True
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ class GameConfig(AppConfig):
|
|||||||
verbose_name_plural = 'Games'
|
verbose_name_plural = 'Games'
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
pass
|
from game import signals # noqa
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ from .models import EventTypes, Game, GameEvent, GameStatuses
|
|||||||
@receiver(post_save, sender=Game)
|
@receiver(post_save, sender=Game)
|
||||||
def game_start(sender, signal, instance, **kwargs):
|
def game_start(sender, signal, instance, **kwargs):
|
||||||
"""If the game was just created, insert the first event START_GAME"""
|
"""If the game was just created, insert the first event START_GAME"""
|
||||||
if not instance.status == GameStatuses.NOT_PLAYED:
|
if instance.status != GameStatuses.NOT_PLAYED:
|
||||||
return
|
return
|
||||||
GameEvent.objects.get_or_create(game=instance, type=EventTypes.START_GAME)
|
GameEvent.objects.get_or_create(game=instance, type=EventTypes.START_GAME)
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ def game_start(sender, signal, instance, **kwargs):
|
|||||||
@receiver(pre_save, sender=GameEvent)
|
@receiver(pre_save, sender=GameEvent)
|
||||||
def identify_click_event(sender, signal, instance, **kwargs):
|
def identify_click_event(sender, signal, instance, **kwargs):
|
||||||
"""Verify what is on the naive click: mine, point or empty"""
|
"""Verify what is on the naive click: mine, point or empty"""
|
||||||
if not instance.type == EventTypes.CLICK_NAIVE:
|
if instance.type != EventTypes.CLICK_NAIVE:
|
||||||
return
|
return
|
||||||
|
|
||||||
if instance.row is None and instance.col is None:
|
if instance.row is None and instance.col is None:
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ lint.ignore = [
|
|||||||
"RUF012",
|
"RUF012",
|
||||||
"N806",
|
"N806",
|
||||||
"ARG002",
|
"ARG002",
|
||||||
|
"PGH004",
|
||||||
"N805", # Missing type annotation for self in method (Pydantic don't like this)
|
"N805", # Missing type annotation for self in method (Pydantic don't like this)
|
||||||
"SIM108", # Use ternary operator {contents} instead of if-else-block
|
"SIM108", # Use ternary operator {contents} instead of if-else-block
|
||||||
"RUF009", # Missing dataclass field.
|
"RUF009", # Missing dataclass field.
|
||||||
|
|||||||
Reference in New Issue
Block a user