diff --git a/rowers/models.py b/rowers/models.py index 8e9ed3f8..a3f0d391 100644 --- a/rowers/models.py +++ b/rowers/models.py @@ -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( diff --git a/rowers/templates/entryedit.html b/rowers/templates/entryedit.html new file mode 100644 index 00000000..fc1d5848 --- /dev/null +++ b/rowers/templates/entryedit.html @@ -0,0 +1,71 @@ +{% extends "newbase.html" %} +{% load staticfiles %} +{% load rowerfilters %} + +{% block title %}Register for a Virtual Race{% endblock %} + +{% block meta %} + + + +{% endblock %} + + +{% block main %} +
{% if race|is_final %}
| {{ result.points|sigdig:4 }} | {% endif %}- - Details + + + | ++ {% if result.userid == request.user.rower.id and not race|is_final %} + + + + {% endif %} | -{% if race.manager == request.user and not race|is_final %} - - Disqualify + + {% else %} @@ -345,8 +360,8 @@ | {% if result.userid == request.user.rower.id and not race|is_final %} - - Remove + + {% endif %} | @@ -380,7 +395,7 @@DNF | - Details + | {% endfor %} @@ -415,19 +430,6 @@
- Compare Results - {% if race.sessiontype == 'race' %} - Compare Course - {% endif %} -
- {% if race.manager == request.user %} -- Download Results -
{% endif %} {% else %}@@ -506,11 +508,21 @@ {% endif %} {% endif %} - {% if record.userid == rower.id and 'withdrawbutton' in buttons %} + {% if record.userid == request.user.rower.id and not race|is_final %}