|
1 | 1 | from django import forms |
2 | | -from django.core.mail import send_mail |
3 | | -from django.template import loader |
4 | | -from django.conf import settings |
5 | 2 | from django.utils.safestring import mark_safe |
6 | 3 | from django.utils.translation import gettext_lazy as _ |
7 | 4 | from django.contrib.auth.models import User |
8 | | -from django.contrib.sites.shortcuts import get_current_site |
9 | 5 |
|
10 | 6 | import ctf_gameserver.web.scoring.models as scoring_models |
11 | 7 |
|
12 | 8 | from .models import Team |
13 | 9 | from .fields import ClearableThumbnailImageInput |
14 | | -from .util import email_token_generator, get_country_names |
| 10 | +from .util import get_country_names |
15 | 11 |
|
16 | 12 | FIVE_MB = 5 * 1024**2 |
17 | 13 |
|
@@ -85,28 +81,6 @@ def save(self, commit=True): |
85 | 81 |
|
86 | 82 | return user |
87 | 83 |
|
88 | | - def send_confirmation_mail(self, request): |
89 | | - """ |
90 | | - Sends an email containing the address confirmation link to the user associated with this form. As it |
91 | | - requires a User instance, it should only be called after the object has initially been saved. |
92 | | -
|
93 | | - Args: |
94 | | - request: The HttpRequest from which this function is being called |
95 | | - """ |
96 | | - competition_name = scoring_models.GameControl.get_instance().competition_name |
97 | | - |
98 | | - context = { |
99 | | - 'competition_name': competition_name, |
100 | | - 'protocol': 'https' if request.is_secure() else 'http', |
101 | | - 'domain': get_current_site(request), |
102 | | - 'user': self.instance.pk, |
103 | | - 'token': email_token_generator.make_token(self.instance) |
104 | | - } |
105 | | - message = loader.render_to_string('confirmation_mail.txt', context) |
106 | | - |
107 | | - send_mail(competition_name+' email confirmation', message, settings.DEFAULT_FROM_EMAIL, |
108 | | - [self.instance.email]) |
109 | | - |
110 | 84 |
|
111 | 85 | class TeamForm(forms.ModelForm): |
112 | 86 | """ |
|
0 commit comments