Skip to content

Commit

Permalink
merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
apollo1291 committed Jan 25, 2023
2 parents 6780548 + 48d62e2 commit 95cb175
Show file tree
Hide file tree
Showing 63 changed files with 2,162 additions and 464 deletions.
2 changes: 2 additions & 0 deletions backend/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ dependencies:
- django_rest_passwordreset==1.3.0
- djangorestframework-simplejwt==5.2.2
- google-cloud-scheduler==2.7.3
- google-cloud-tasks==2.12.0
- requests==2.28.1
33 changes: 29 additions & 4 deletions backend/siarnaq/api/compete/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,19 @@ def has_delete_permission(self, request, obj=None):
class MatchParticipantInline(admin.TabularInline):
model = MatchParticipant
extra = 0
fields = ("team", "submission", "player_index", "score", "rating")
fields = (
"team",
"submission",
"player_index",
"score",
"rating",
"external_id_private",
"external_id_public",
)
max_num = 2
ordering = ("player_index",)
raw_id_fields = ("team", "submission")
readonly_fields = ("rating",)
readonly_fields = ("rating", "external_id_private", "external_id_public")

def get_queryset(self, request):
return (
Expand All @@ -102,7 +110,6 @@ class MatchAdmin(admin.ModelAdmin):
{
"fields": (
"episode",
"tournament_round",
"replay",
"alternate_order",
"is_ranked",
Expand All @@ -116,6 +123,16 @@ class MatchAdmin(admin.ModelAdmin):
"fields": ("status", "created", "num_failures", "logs"),
},
),
(
"Tournament metadata",
{
"fields": (
"tournament_round",
"external_id_private",
"external_id_public",
),
},
),
)
inlines = [MatchParticipantInline]
list_display = (
Expand All @@ -128,7 +145,15 @@ class MatchAdmin(admin.ModelAdmin):
list_filter = ("episode", "status")
ordering = ("-pk",)
raw_id_fields = ("tournament_round",)
readonly_fields = ("replay", "status", "created", "num_failures", "logs")
readonly_fields = (
"replay",
"status",
"created",
"num_failures",
"logs",
"external_id_private",
"external_id_public",
)

def formfield_for_manytomany(self, db_field, request, **kwargs):
pk = request.resolver_match.kwargs.get("object_id", None)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.1.2 on 2023-01-17 06:57

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("compete", "0003_initial"),
]

operations = [
migrations.AddField(
model_name="match",
name="challonge_id",
field=models.IntegerField(blank=True, null=True, unique=True),
),
migrations.AddField(
model_name="matchparticipant",
name="challonge_id",
field=models.CharField(blank=True, max_length=64, null=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 4.1.2 on 2023-01-21 18:05

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("compete", "0004_match_challonge_id_matchparticipant_challonge_id"),
]

operations = [
migrations.RenameField(
model_name="match",
old_name="challonge_id",
new_name="external_id_private",
),
migrations.RemoveField(
model_name="matchparticipant",
name="challonge_id",
),
migrations.AddField(
model_name="matchparticipant",
name="external_id",
field=models.CharField(blank=True, max_length=64, null=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.1.2 on 2023-01-23 10:07

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("compete", "0005_rename_challonge_id_match_external_id_private_and_more"),
]

operations = [
migrations.RenameField(
model_name="matchparticipant",
old_name="external_id",
new_name="external_id_private",
),
migrations.AddField(
model_name="match",
name="external_id_public",
field=models.IntegerField(blank=True, null=True, unique=True),
),
migrations.AddField(
model_name="matchparticipant",
name="external_id_public",
field=models.CharField(blank=True, max_length=64, null=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 4.1.2 on 2023-01-24 15:10

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
(
"episodes",
"0005_remove_tournamentround_round-unique-tournament-challonge_and_more",
),
(
"compete",
"0006_rename_external_id_matchparticipant_external_id_private_and_more",
),
]

operations = [
migrations.AlterField(
model_name="match",
name="tournament_round",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="matches",
to="episodes.tournamentround",
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Django 4.1.2 on 2023-01-24 16:58

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
("compete", "0007_alter_match_tournament_round"),
]

operations = [
migrations.AlterField(
model_name="matchparticipant",
name="match",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="participants",
to="compete.match",
),
),
migrations.AlterField(
model_name="matchparticipant",
name="previous_participation",
field=models.OneToOneField(
blank=True,
null=True,
on_delete=django.db.models.deletion.RESTRICT,
related_name="next_participation",
to="compete.matchparticipant",
),
),
]
Loading

0 comments on commit 95cb175

Please sign in to comment.