Fix concurrent login and duplicate UserKnownLoginSources (#4880)

This commit is contained in:
Richard Schreiber
2025-03-18 10:24:15 +01:00
committed by GitHub
parent ac8cb3bfd1
commit 7da03ac17c
2 changed files with 44 additions and 0 deletions

View File

@@ -602,6 +602,9 @@ class UserKnownLoginSource(models.Model):
country = FastCountryField(null=True, blank=True)
last_seen = models.DateTimeField()
class Meta:
unique_together = ('user', 'agent_type', 'device_type', 'os_type', 'country')
class StaffSession(models.Model):
user = models.ForeignKey('User', on_delete=models.PROTECT)