Private
Public Access
1
0

race entry self service

This commit is contained in:
Sander Roosendaal
2020-06-23 21:48:33 +02:00
parent 765d8052aa
commit ce51bbc26c
5 changed files with 388 additions and 25 deletions

View File

@@ -3002,6 +3002,34 @@ class VirtualRaceResult(models.Model):
acceptsocialmedia = models.BooleanField(default=True,
verbose_name = 'I agree with sharing my name in challenge related social media posts (unchecking this does not prevent you from participation)')
def isduplicate(self,other):
if self.userid != other.userid:
return False
if self.weightcategory != other.weightcategory:
return False
if self.adaptiveclass != other.adaptiveclass:
return False
if self.skillclass != other.skillclass:
return False
if self.race != other.race:
return False
if self.boatclass != other.boatclass:
return False
if self.boattype != other.boattype:
return False
if self.sex != other.sex:
return False
if self.entrycategory is not None and other.entrycategory is not None:
if self.entrycategory != other.entrycategory:
return False
elif self.entrycategory is None and other.entrycateogry is not None:
return False
elif self.entrycategory is not None and other.entrycategory is None:
return False
return True
def __str__(self):
rr = Rower.objects.get(id=self.userid)
name = '{u1} {u2}'.format(
@@ -3080,6 +3108,31 @@ class IndoorVirtualRaceResult(models.Model):
acceptsocialmedia = models.BooleanField(default=True,
verbose_name = 'I agree with sharing my name in challenge related social media posts (unchecking this does not prevent you from participation)')
def isduplicate(self,other):
if self.userid != other.userid:
return False
if self.weightcategory != other.weightcategory:
return False
if self.adaptiveclass != other.adaptiveclass:
return False
if self.skillclass != other.skillclass:
return False
if self.race != other.race:
return False
if self.boatclass != other.boatclass:
return False
if self.sex != other.sex:
return False
if self.entrycategory is not None and other.entrycategory is not None:
if self.entrycategory != other.entrycategory:
return False
elif self.entrycategory is None and other.entrycategory is not None:
return False
elif self.entrycategory is not None and other.entrycategory is None:
return False
return True
def __str__(self):
rr = Rower.objects.get(id=self.userid)
name = '{u1} {u2}'.format(