Fix class name 5
This commit is contained in:
@ -44,6 +44,7 @@ class EntryCSVProcessor:
|
|||||||
try:
|
try:
|
||||||
self.process_csv_row(row)
|
self.process_csv_row(row)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
print(f'Error processing upload: {str(e)}')
|
||||||
messages.error(request, f'Error in row: {str(e)}')
|
messages.error(request, f'Error in row: {str(e)}')
|
||||||
return redirect('..')
|
return redirect('..')
|
||||||
|
|
||||||
@ -79,6 +80,7 @@ class EntryCSVProcessor:
|
|||||||
self._create_entry(row, team, user)
|
self._create_entry(row, team, user)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
print(f'Error on process_csv_row : {str(e)}')
|
||||||
raise ValidationError(f"Error processing row: {str(e)}")
|
raise ValidationError(f"Error processing row: {str(e)}")
|
||||||
|
|
||||||
def _get_or_create_user(self, row: Dict[str, Any]) -> CustomUser:
|
def _get_or_create_user(self, row: Dict[str, Any]) -> CustomUser:
|
||||||
@ -157,6 +159,7 @@ class EntryCSVProcessor:
|
|||||||
sexclass = '女子'
|
sexclass = '女子'
|
||||||
|
|
||||||
category_name = f"{row['department']}{sexclass}-{timeclass}"
|
category_name = f"{row['department']}{sexclass}-{timeclass}"
|
||||||
|
print(f'設定カテゴリ名:{category_name}')
|
||||||
try:
|
try:
|
||||||
category = NewCategory.objects.get(category_name=category_name)
|
category = NewCategory.objects.get(category_name=category_name)
|
||||||
row['zekken_number'] = category.category_number
|
row['zekken_number'] = category.category_number
|
||||||
@ -214,7 +217,7 @@ class EntryCSVProcessor:
|
|||||||
'password': make_password('dummy_password'),
|
'password': make_password('dummy_password'),
|
||||||
'firstname': first_name,
|
'firstname': first_name,
|
||||||
'lastname': last_name,
|
'lastname': last_name,
|
||||||
'date_of_birth': birth_date,
|
'date_of_birth': birfth_date,
|
||||||
'female': is_female
|
'female': is_female
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -224,6 +227,7 @@ class EntryCSVProcessor:
|
|||||||
user=dummy_user,
|
user=dummy_user,
|
||||||
defaults={'is_temporary': True}
|
defaults={'is_temporary': True}
|
||||||
)
|
)
|
||||||
|
print(f'メンバー作成:{dummy_user.email}')
|
||||||
|
|
||||||
def _create_entry(self, row: Dict[str, Any], team: Team, owner: CustomUser) -> None:
|
def _create_entry(self, row: Dict[str, Any], team: Team, owner: CustomUser) -> None:
|
||||||
"""
|
"""
|
||||||
@ -241,6 +245,7 @@ class EntryCSVProcessor:
|
|||||||
zekken_number=zekken_no,
|
zekken_number=zekken_no,
|
||||||
is_active=False
|
is_active=False
|
||||||
)
|
)
|
||||||
|
print(f'エントリー作成:{team.team_name} - {event.event_name}')
|
||||||
except NewEvent2.DoesNotExist:
|
except NewEvent2.DoesNotExist:
|
||||||
raise ValidationError(f"Event with code {row['event_code']} does not exist")
|
raise ValidationError(f"Event with code {row['event_code']} does not exist")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user