Laurent 9 months ago
commit 8acf5e9b37
  1. 1
      api/serializers.py
  2. 8
      tournaments/models/match.py
  3. 15
      tournaments/templates/tournaments/acc_active_email.html
  4. 1
      tournaments/views.py

@ -89,6 +89,7 @@ class UserSerializer(serializers.ModelSerializer):
'token': account_activation_token.make_token(user), 'token': account_activation_token.make_token(user),
}) })
email = EmailMessage(mail_subject, message, to=[user.email]) email = EmailMessage(mail_subject, message, to=[user.email])
email.content_subtype = "html"
email.send() email.send()
class Meta: class Meta:

@ -158,11 +158,11 @@ class Match(models.Model):
# No team scores at all # No team scores at all
if previous_top_match: if previous_top_match:
names = [f"Gagnants du {previous_top_match.computed_name()}", ''] names = [f"Gagnants {previous_top_match.computed_name()}", '']
team = self.default_live_team(names) team = self.default_live_team(names)
teams.append(team) teams.append(team)
if previous_bottom_match: if previous_bottom_match:
names = [f"Gagnants du {previous_bottom_match.computed_name()}", ''] names = [f"Gagnants {previous_bottom_match.computed_name()}", '']
team = self.default_live_team(names) team = self.default_live_team(names)
teams.append(team) teams.append(team)
elif len(team_scores) == 1: elif len(team_scores) == 1:
@ -174,12 +174,12 @@ class Match(models.Model):
teams.append(existing_team) teams.append(existing_team)
else: else:
if previous_top_match and previous_top_match.disabled == False and previous_top_match.end_date is None: if previous_top_match and previous_top_match.disabled == False and previous_top_match.end_date is None:
names = [f"Gagnants du {previous_top_match.computed_name()}", ''] names = [f"Gagnants {previous_top_match.computed_name()}", '']
team = self.default_live_team(names) team = self.default_live_team(names)
teams.append(team) teams.append(team)
teams.append(existing_team) teams.append(existing_team)
elif previous_bottom_match: elif previous_bottom_match:
names = [f"Gagnants du {previous_bottom_match.computed_name()}", ''] names = [f"Gagnants {previous_bottom_match.computed_name()}", '']
team = self.default_live_team(names) team = self.default_live_team(names)
teams.append(existing_team) teams.append(existing_team)
teams.append(team) teams.append(team)

@ -1,13 +1,16 @@
<html>
<body>
{% autoescape off %} {% autoescape off %}
Bienvenue {{ user.username }} ! Bienvenue {{ user.username }} !
Veuillez cliquer sur le lien suivant pour activer votre compte: <br><br>Veuillez cliquer sur le lien suivant pour activer votre compte :<br>
padelclub://{{ domain }}{% url 'activate' uidb64=uid token=token %}?next={{ next }} <a href="padelclub://{{ domain }}{% url 'activate' uidb64=uid token=token %}">Activer mon compte</a>
Si le lien ne marche pas, cliquer ici : <br><br>Si le lien ne marche pas, cliquez <a href="http://{{ domain }}{% url 'activate' uidb64=uid token=token %}?next=index">ici</a>.
http://{{ domain }}{% url 'activate' uidb64=uid token=token %}?next={{ next }}
Une fois votre compte activé, connectez-vous dans l'app. <br>Une fois votre compte activé, connectez-vous dans l'app.
A tout de suite sur Padel Club ! <br><br>À tout de suite sur <a href="https://padelclub.app">Padel Club</a> !
{% endautoescape %} {% endautoescape %}
</body>
</html>

@ -657,6 +657,7 @@ def send_verification_email(request, user, next_url):
}) })
email = EmailMessage(mail_subject, message, to=[user.email]) email = EmailMessage(mail_subject, message, to=[user.email])
email.content_subtype = "html"
email.send() email.send()
@login_required @login_required

Loading…
Cancel
Save