From 8d6d16c124cc18512c8c65af645c4b88bd1198db Mon Sep 17 00:00:00 2001 From: Jason Date: Sat, 9 Dec 2023 22:38:29 -0500 Subject: [PATCH] fix: doesn't ref .through as it's not a manager removes is_solo and all solo teams removes empty translate ref as empty string doesn't result in empty translation + compiles said translations --- .idea/scavenger.iml | 2 +- core/admin.py | 2 - core/locale/ja_JP/LC_MESSAGES/django.mo | Bin 2554 -> 2023 bytes core/locale/ja_JP/LC_MESSAGES/django.po | 151 +++++++++++---------- core/migrations/0021_alter_hint_options.py | 16 --- core/migrations/0022_remove_team_solo.py | 16 +++ core/models.py | 5 +- core/templates/core/base.html | 6 +- core/templates/core/index.html | 18 +-- core/urls.py | 1 - core/views/qr.py | 2 +- core/views/team.py | 13 -- 12 files changed, 105 insertions(+), 127 deletions(-) delete mode 100644 core/migrations/0021_alter_hint_options.py create mode 100644 core/migrations/0022_remove_team_solo.py diff --git a/.idea/scavenger.iml b/.idea/scavenger.iml index 7a335b4..7acc9e6 100644 --- a/.idea/scavenger.iml +++ b/.idea/scavenger.iml @@ -14,7 +14,7 @@ - + diff --git a/core/admin.py b/core/admin.py index 76d3b7f..1a18489 100644 --- a/core/admin.py +++ b/core/admin.py @@ -45,8 +45,6 @@ def clean(self): raise ValidationError( f"Teams for hunt: {self.instance.hunt.name} can only have a max of {self.instance.hunt.max_team_size} members. You tried to set it to {total_objs}" ) - elif self.instance.is_solo and total_objs > 1: - raise ValidationError("Solo groups can only have one member") elif total_objs <= 0: if self.request is not None: messages.warning( diff --git a/core/locale/ja_JP/LC_MESSAGES/django.mo b/core/locale/ja_JP/LC_MESSAGES/django.mo index 00d2ad3d848800f253062924240a66b73e4a2103..fdff195f17c63df49170f54356d8f1dd99201baf 100644 GIT binary patch delta 675 zcmXZazb}J99LMpiKK-G^Q*E`XQc^#fu!w{(85ryagV83D5L=gqMIsWzrGJ6g5K@~- z6H5mPn?{7mWH1pS@%}vS((m)Sd#=yj_xaxQoq6+X&uOo2XoD_(aEy2gaiMK>7&C&~ zIEi)a#~X}b8};l9#_$(CjD-J9U=L#-3s}M^&SBn|npvPz4$l6Ny#NLNz?7lZ{ue_Px# delta 1198 zcmY+?Pe@cj90%}mSD$9(mS+C1Ndv*eP8LZd27=M0KhQxB@zR&Ox$cYI74@{vds6Ds zAAFcZfrg=wmYG3VYIq2OSm@HREBx3;PCn;-7FQ z^r4Z>gXNfCl;ULv8jgE5!2;CJ!hCoc?txKQgx#^d`U9-y0NUr^G57&W=)xB74Ua4FpL!lFfm*S;HK*WJZ%6W9+J(d@*^6Wkku~~tI!RVC zJ$#GQEDb2yo=fUJzLH9kt;k*`dy>@5|Hh4l*JLSD)0}JBKbDms%OZ6nJ%gN8Qd6WR zIN2J;&>Q!jlNu*ANOrk5*!s#tclc+d=E)u)`w^*0XGm+%@MUA@uCt~!2ez+BI3Kk_ Ir!+hD7lr%-0ssI2 diff --git a/core/locale/ja_JP/LC_MESSAGES/django.po b/core/locale/ja_JP/LC_MESSAGES/django.po index 4fd3628..25a31d8 100644 --- a/core/locale/ja_JP/LC_MESSAGES/django.po +++ b/core/locale/ja_JP/LC_MESSAGES/django.po @@ -2,14 +2,13 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# -#: .\core\templates\core\base.html:22 +# #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-05 00:21-0500\n" +"POT-Creation-Date: 2023-12-09 22:30-0500\n" "PO-Revision-Date: 2022-12-16 20:24+EST\n" "Last-Translator: にぃゆい <+@nyiyui.ca>\n" "Language-Team: LANGUAGE \n" @@ -18,15 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: .\core\admin.py:14 -msgid "Set selected users as a Location Setter" -msgstr "" - -#: .\core\admin.py:25 -msgid "Set selected users as a Logic Puzzle Setter" -msgstr "" - -#: .\core\admin.py:117 +#: .\core\admin.py:112 msgid "Link to Hint Page" msgstr "" @@ -50,23 +41,23 @@ msgstr "" msgid "ago" msgstr "" -#: .\core\templates\core\base.html:104 +#: .\core\templates\core\base.html:100 msgid "Home" msgstr "ホーム" -#: .\core\templates\core\base.html:111 +#: .\core\templates\core\base.html:107 msgid "Admin" msgstr "管理" -#: .\core\templates\core\base.html:116 +#: .\core\templates\core\base.html:112 msgid "current" msgstr "最新ヒント" -#: .\core\templates\core\base.html:120 .\core\templates\core\logout.html:6 +#: .\core\templates\core\base.html:116 .\core\templates\core\logout.html:6 msgid "Logout" msgstr "ログアウト" -#: .\core\templates\core\base.html:127 +#: .\core\templates\core\base.html:123 msgid "Login" msgstr "" @@ -98,7 +89,11 @@ msgstr "" msgid "hints" msgstr "ヒント" -#: .\core\templates\core\credits.html:48 +#: .\core\templates\core\credits.html:47 +msgid "logic puzzle" +msgstr "" + +#: .\core\templates\core\credits.html:53 msgid "support" msgstr "" @@ -132,7 +127,7 @@ msgstr "" "\n" "%(username)s、ようこそ!\n" -#: .\core\templates\core\index.html:25 +#: .\core\templates\core\index.html:26 #, fuzzy, python-format #| msgid "" #| "\n" @@ -141,9 +136,9 @@ msgstr "" #| " " msgid "" "\n" -" %(hunt_name)s has started! go decrypt your first hint!\n" -" " +" " msgstr "" "\n" "がらくた集め、開始!最初の二次元コードを当て" @@ -158,23 +153,14 @@ msgstr "" #| " " msgid "" "\n" -" or, would you like to invite more team " +" or, would you like to invite more team " "members?\n" -" " -msgstr "" -"\n" -"未だメンバー招待も出来るよ。" - -#: .\core\templates\core\index.html:39 -msgid "" -"\n" -" you're going solo\n" " " msgstr "" "\n" -"ソロプレイ" +"未だメンバー招待も出来るよ。" -#: .\core\templates\core\index.html:43 +#: .\core\templates\core\index.html:37 #, python-format msgid "" "\n" @@ -184,17 +170,20 @@ msgstr "" "\n" "チームプレイ:%(team)s" -#: .\core\templates\core\index.html:52 .\core\templates\core\team_join.html:10 +#: .\core\templates\core\index.html:45 .\core\templates\core\team_join.html:22 msgid "join a team" msgstr "チームに参加" -#: .\core\templates\core\index.html:55 .\core\templates\core\team_new.html:10 +#: .\core\templates\core\index.html:48 .\core\templates\core\team_new.html:21 msgid "make a team" msgstr "チームを作る" -#: .\core\templates\core\index.html:62 -msgid "go solo " -msgstr "ソロプレイ" +#: .\core\templates\core\index.html:55 +msgid "" +"\n" +" no future scavenger hunt is scheduled, please check back later\n" +" " +msgstr "" #: .\core\templates\core\logout.html:10 .\core\templates\core\logout.html:16 #, fuzzy @@ -272,15 +261,11 @@ msgstr "" msgid "Join a Team" msgstr "チームに参加" -#: .\core\templates\core\team_join.html:14 +#: .\core\templates\core\team_join.html:24 msgid "either enter your team's join code" msgstr "チームの参加コードを入れるか" -#: .\core\templates\core\team_join.html:18 -msgid "Join" -msgstr "参加" - -#: .\core\templates\core\team_join.html:20 +#: .\core\templates\core\team_join.html:34 msgid "or, scan your team's QR code" msgstr "チームの二次元コードをスキャンしてにゃ" @@ -290,63 +275,93 @@ msgstr "チームの二次元コードをスキャンしてにゃ" msgid "Make a Team" msgstr "チームを作る" -#: .\core\templates\core\team_new.html:24 -msgid "create" -msgstr "作成" +#: .\core\utils\actions.py:33 +msgid "Set selected users as a Logic Puzzle Setter" +msgstr "" + +#: .\core\utils\actions.py:43 +msgid "Remove selected users as a Logic Puzzle Setter" +msgstr "" + +#: .\core\utils\actions.py:53 +msgid "Set selected users as a Qr Code Setter" +msgstr "" + +#: .\core\utils\actions.py:63 +msgid "Remove selected users as a Qr Code Setter" +msgstr "" #: .\core\views\qr.py:27 -msgid "Please join a team or choose to go solo before getting a hint." +#, fuzzy +#| msgid "Please join a team or choose to go solo before getting a hint." +msgid "Please join or create a team before getting a hint." msgstr "ヒントを見る前に、ソロプレイするかチームでするか決めてにゃ!" -#: .\core\views\qr.py:41 +#: .\core\views\qr.py:40 msgid "No future hunts are scheduled." msgstr "" -#: .\core\views\qr.py:70 +#: .\core\views\qr.py:62 +#, fuzzy +#| msgid "Since the hunt has already begun, switching teams is disallowed." +msgid "" +"Since the hunt has already begun, creating/switching/joining teams is " +"disallowed. If you need to do one of the above, please contact an organizer." +msgstr "もう始まってるから、チーム変えるのはダメダメだからね。" + +#: .\core\views\qr.py:90 msgid "No hunt is currently active." msgstr "" -#: .\core\views\qr.py:88 +#: .\core\views\qr.py:107 #, fuzzy #| msgid "Contest has not started yet." msgid "Contest has ended." msgstr "未だ始まってないよ〜" -#: .\core\views\qr.py:93 +#: .\core\views\qr.py:112 msgid "Contest has not started yet." msgstr "未だ始まってないよ〜" -#: .\core\views\qr.py:138 +#: .\core\views\qr.py:167 msgid "You are not on the first QR code." msgstr "" -#: .\core\views\team.py:26 -#, fuzzy -#| msgid "Since the hunt has already begun, switching teams is disallowed." -msgid "" -"Since the hunt has already begun, switching teams is disallowed. If you need " -"to switch teams, please contact an admin." -msgstr "もう始まってるから、チーム変えるのはダメダメだからね。" - -#: .\core\views\team.py:46 +#: .\core\views\team.py:37 #, python-format msgid "Joined team %(team_name)s" msgstr "チーム%(team_name)sに参加したにゃ" -#: .\core\views\team.py:52 +#: .\core\views\team.py:43 #, python-format msgid "Team %(team_name)s is full." msgstr "チーム%(team_name)sはもう満杯だよ" -#: .\core\views\team.py:71 -msgid "Since the hunt has already begun, making new teams is disallowed." -msgstr "もう始まったから、新しいチーム作るのはダメだよ。" - -#: .\core\views\team.py:87 +#: .\core\views\team.py:75 #, python-format msgid "Made team %(team_name)s" msgstr "チーム%(team_name)sをつくったよ。" +#~ msgid "" +#~ "\n" +#~ " you're going solo\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ "ソロプレイ" + +#~ msgid "go solo " +#~ msgstr "ソロプレイ" + +#~ msgid "Join" +#~ msgstr "参加" + +#~ msgid "create" +#~ msgstr "作成" + +#~ msgid "Since the hunt has already begun, making new teams is disallowed." +#~ msgstr "もう始まったから、新しいチーム作るのはダメだよ。" + #~ msgid "__startsPost" #~ msgstr "で始まるにゃ" diff --git a/core/migrations/0021_alter_hint_options.py b/core/migrations/0021_alter_hint_options.py deleted file mode 100644 index 5b664f5..0000000 --- a/core/migrations/0021_alter_hint_options.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 4.1.13 on 2023-12-08 01:15 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("core", "0020_alter_logicpuzzlehint_qr_index_and_more"), - ] - - operations = [ - migrations.AlterModelOptions( - name="hint", - options={}, - ), - ] diff --git a/core/migrations/0022_remove_team_solo.py b/core/migrations/0022_remove_team_solo.py new file mode 100644 index 0000000..69acab5 --- /dev/null +++ b/core/migrations/0022_remove_team_solo.py @@ -0,0 +1,16 @@ +# Generated by Django 4.1.13 on 2023-12-10 03:34 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("core", "0021_alter_hint_options_qrcode_created_at_teammembership_and_more"), + ] + + operations = [ + migrations.RemoveField( + model_name="team", + name="solo", + ), + ] diff --git a/core/models.py b/core/models.py index ba79f56..0f64175 100644 --- a/core/models.py +++ b/core/models.py @@ -163,7 +163,6 @@ class Team(models.Model): default=False ) # todo use this field to have a club-like page so you can join an open team (future feature) current_qr_i = models.IntegerField(default=0) - solo = models.BooleanField(default=False) members = models.ManyToManyField( User, related_name="teams", related_query_name="teams", through=TeamMembership ) @@ -173,7 +172,7 @@ def leave(self, member: User): if self.members.filter(id=member.id).first() is None: raise IndexError("User is not in team") # remove the member - self.members.through.remove(member) + self.members.remove(member) # noqa def update_current_qr_i(self, i: int): self.current_qr_i = max(self.current_qr_i, i) @@ -192,7 +191,7 @@ def join(self, user: User): return if self.is_full: raise IndexError("Team is full") - self.members.through.add(user) + self.members.add(user) # noqa def invites(self): return Invite.objects.filter(team=self) diff --git a/core/templates/core/base.html b/core/templates/core/base.html index bbc51f2..2c994c0 100644 --- a/core/templates/core/base.html +++ b/core/templates/core/base.html @@ -19,7 +19,7 @@ {{ START.timestamp }} * 1000, {{ END.timestamp }} * 1000, "{{ hunt.name }} {% translate "starts in" %}", {# starts pre #} - "{% translate '' %}", {# starts post #} + "", {# starts post #} "{% translate 'Only' %}", {# ends pre #} "{% translate 'remaining' %}", {# ends post #} "{{ hunt.name }} {% translate 'ended' %}", {# ended pre #} @@ -85,11 +85,7 @@

{% block header %}{% endblock %}