Fix GpsCheckin

This commit is contained in:
2025-08-29 20:05:34 +09:00
parent 23a9902885
commit 42f6471f73
2 changed files with 40 additions and 41 deletions

View File

@ -927,6 +927,9 @@ class GpsCheckin(models.Model):
event_id = models.BigIntegerField(null=True, blank=True)
team_id = models.BigIntegerField(null=True, blank=True)
checkpoint_id = models.BigIntegerField(null=True, blank=True)
# データベースの実際のフィールドと一致させる
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
db_table = 'rog_gpscheckin'
@ -935,14 +938,6 @@ class GpsCheckin(models.Model):
def __str__(self):
return f"GPS Checkin {self.id} - {self.zekken}"
def save(self, *args, **kwargs):
# 作成時・更新時のタイムスタンプを自動設定
from django.utils import timezone
if not self.create_at:
self.create_at = timezone.now()
self.update_at = timezone.now()
super().save(*args, **kwargs)
class RogUser(models.Model):
user=models.OneToOneField(CustomUser, on_delete=models.CASCADE)
phone=models.CharField(_('Phone Number'), max_length=55)