Fix teams error

This commit is contained in:
2025-09-05 17:29:11 +09:00
parent 4e1ef7c230
commit 9d11685b65
3 changed files with 18 additions and 3 deletions

View File

@ -0,0 +1,5 @@
部門別数,時間,部門,"チーム名
",メール,パスワード,電話番号,氏名1,誕生日1,氏名2,誕生日2,氏名3,誕生日3,氏名4,誕生日4,氏名5,誕生日5,氏名6,誕生日6,氏名7,誕生日7,,
2,5,お試し・ファミリー,fun!fun!うごchan,fulayota333@gmail.com,ha7384,090-6599-7384,早川宏美,1975/6/15,,,,,,,,,,,,,,
1,5,お試し・ファミリー,ポエドリ,takagitoshihiro8@yahoo.co.jp,ta4245,090-5866-4245,高木俊裕,1984/03/09,,,,,,,,,,,,,,
7,5,男性ソロ,前川一彦,yoshino-chuo@docomo.ne.jp,ma2351,090-1074-2351,前川一彦,1990/1/1,,,,,,,,,,,,,,
1 部門別数 時間 部門 チーム名 メール パスワード 電話番号 氏名1 誕生日1 氏名2 誕生日2 氏名3 誕生日3 氏名4 誕生日4 氏名5 誕生日5 氏名6 誕生日6 氏名7 誕生日7
2 2 5 お試し・ファミリー fun!fun!うごchan fulayota333@gmail.com ha7384 090-6599-7384 早川宏美 1975/6/15
3 1 5 お試し・ファミリー ポエドリ takagitoshihiro8@yahoo.co.jp ta4245 090-5866-4245 高木俊裕 1984/03/09
4 7 5 男性ソロ 前川一彦 yoshino-chuo@docomo.ne.jp ma2351 090-1074-2351 前川一彦 1990/1/1

View File

@ -0,0 +1,3 @@
部門別数,時間,部門,チーム名,メール,パスワード,電話番号,氏名1,誕生日1,氏名2,誕生日2,氏名3,誕生日3,氏名4,誕生日4,氏名5,誕生日5,氏名6,誕生日6,氏名7,誕生日7,,
1,3,お試し,テスト一人お試し,test_solo_trial@example.com,test123,090-1234-5678,山田太郎,1990/4/15,,,,,,,,,,,,
2,5,お試し,テスト一人お試し2,test_solo_trial2@example.com,test456,090-1234-5679,佐藤花子,1985/8/20,,,,,,,,,,,,
1 部門別数,時間,部門,チーム名,メール,パスワード,電話番号,氏名1,誕生日1,氏名2,誕生日2,氏名3,誕生日3,氏名4,誕生日4,氏名5,誕生日5,氏名6,誕生日6,氏名7,誕生日7,,
2 1,3,お試し,テスト一人お試し,test_solo_trial@example.com,test123,090-1234-5678,山田太郎,1990/4/15,,,,,,,,,,,,
3 2,5,お試し,テスト一人お試し2,test_solo_trial2@example.com,test456,090-1234-5679,佐藤花子,1985/8/20,,,,,,,,,,,,

View File

@ -428,7 +428,7 @@ class Command(BaseCommand):
duration__exact=timedelta(hours=duration_hours) duration__exact=timedelta(hours=duration_hours)
).order_by('-num_of_member') # メンバー数が多い順 ).order_by('-num_of_member') # メンバー数が多い順
# メンバー数に適したカテゴリーを選択 # メンバー数に適したカテゴリーを選択お試しは1名でも可
for cat in trial_categories: for cat in trial_categories:
if cat.num_of_member >= member_count: if cat.num_of_member >= member_count:
category = cat category = cat
@ -458,7 +458,13 @@ class Command(BaseCommand):
if not category: if not category:
# 3. どれも見つからない場合は新規作成(メンバー数を考慮) # 3. どれも見つからない場合は新規作成(メンバー数を考慮)
max_members = max(7, member_count) # 最低でも現在のメンバー数は受け入れる if is_trial:
# お試しの場合は1名から最大7名まで許可
max_members = max(7, member_count)
else:
# 通常カテゴリーは既存の制限に従う
max_members = max(7, member_count)
full_category_name = f"{category_name}-{duration_hours}時間" full_category_name = f"{category_name}-{duration_hours}時間"
category = NewCategory.objects.create( category = NewCategory.objects.create(
category_name=full_category_name, category_name=full_category_name,
@ -468,7 +474,8 @@ class Command(BaseCommand):
family='ファミリー' in category_name, # ファミリー判定 family='ファミリー' in category_name, # ファミリー判定
category_number=0 category_number=0
) )
self.stdout.write(f' 新規カテゴリー作成: {full_category_name} (最大{max_members}名, お試し={is_trial})') trial_text = f", お試し={is_trial}" if is_trial else ""
self.stdout.write(f' 新規カテゴリー作成: {full_category_name} (最大{max_members}{trial_text})')
else: else:
trial_text = ", お試し" if category.trial else "" trial_text = ", お試し" if category.trial else ""
self.stdout.write(f' 使用カテゴリー: {category.category_name} (最大{category.num_of_member}{trial_text})') self.stdout.write(f' 使用カテゴリー: {category.category_name} (最大{category.num_of_member}{trial_text})')