arthexis 0.1.13__py3-none-any.whl → 0.1.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {arthexis-0.1.13.dist-info → arthexis-0.1.15.dist-info}/METADATA +224 -221
- arthexis-0.1.15.dist-info/RECORD +110 -0
- {arthexis-0.1.13.dist-info → arthexis-0.1.15.dist-info}/licenses/LICENSE +674 -674
- config/__init__.py +5 -5
- config/active_app.py +15 -15
- config/asgi.py +43 -43
- config/auth_app.py +7 -7
- config/celery.py +32 -32
- config/context_processors.py +67 -69
- config/horologia_app.py +7 -7
- config/loadenv.py +11 -11
- config/logging.py +59 -48
- config/middleware.py +25 -25
- config/offline.py +49 -49
- config/settings.py +691 -682
- config/settings_helpers.py +109 -109
- config/urls.py +171 -166
- config/wsgi.py +17 -17
- core/admin.py +3795 -2809
- core/admin_history.py +50 -50
- core/admindocs.py +151 -151
- core/apps.py +356 -272
- core/auto_upgrade.py +57 -57
- core/backends.py +265 -236
- core/changelog.py +342 -0
- core/entity.py +149 -133
- core/environment.py +61 -61
- core/fields.py +168 -168
- core/form_fields.py +75 -75
- core/github_helper.py +188 -25
- core/github_issues.py +178 -172
- core/github_repos.py +72 -0
- core/lcd_screen.py +78 -78
- core/liveupdate.py +25 -25
- core/log_paths.py +114 -100
- core/mailer.py +85 -85
- core/middleware.py +91 -91
- core/models.py +3637 -2795
- core/notifications.py +105 -105
- core/public_wifi.py +267 -227
- core/reference_utils.py +108 -108
- core/release.py +840 -368
- core/rfid_import_export.py +113 -0
- core/sigil_builder.py +149 -149
- core/sigil_context.py +20 -20
- core/sigil_resolver.py +315 -315
- core/system.py +952 -493
- core/tasks.py +408 -394
- core/temp_passwords.py +181 -181
- core/test_system_info.py +186 -139
- core/tests.py +2168 -1521
- core/tests_liveupdate.py +17 -17
- core/urls.py +11 -11
- core/user_data.py +641 -633
- core/views.py +2201 -1417
- core/widgets.py +213 -94
- core/workgroup_urls.py +17 -17
- core/workgroup_views.py +94 -94
- nodes/admin.py +1720 -1161
- nodes/apps.py +87 -85
- nodes/backends.py +160 -160
- nodes/dns.py +203 -203
- nodes/feature_checks.py +133 -133
- nodes/lcd.py +165 -165
- nodes/models.py +1764 -1597
- nodes/reports.py +411 -411
- nodes/rfid_sync.py +195 -0
- nodes/signals.py +18 -0
- nodes/tasks.py +46 -46
- nodes/tests.py +3830 -3116
- nodes/urls.py +15 -14
- nodes/utils.py +121 -105
- nodes/views.py +683 -619
- ocpp/admin.py +948 -948
- ocpp/apps.py +25 -25
- ocpp/consumers.py +1565 -1459
- ocpp/evcs.py +844 -844
- ocpp/evcs_discovery.py +158 -158
- ocpp/models.py +917 -917
- ocpp/reference_utils.py +42 -42
- ocpp/routing.py +11 -11
- ocpp/simulator.py +745 -745
- ocpp/status_display.py +26 -26
- ocpp/store.py +601 -541
- ocpp/tasks.py +31 -31
- ocpp/test_export_import.py +130 -130
- ocpp/test_rfid.py +913 -702
- ocpp/tests.py +4445 -4094
- ocpp/transactions_io.py +189 -189
- ocpp/urls.py +50 -50
- ocpp/views.py +1479 -1251
- pages/admin.py +769 -539
- pages/apps.py +10 -10
- pages/checks.py +40 -40
- pages/context_processors.py +127 -119
- pages/defaults.py +13 -13
- pages/forms.py +198 -198
- pages/middleware.py +209 -153
- pages/models.py +643 -426
- pages/tasks.py +74 -0
- pages/tests.py +3025 -2200
- pages/urls.py +26 -25
- pages/utils.py +23 -12
- pages/views.py +1176 -1128
- arthexis-0.1.13.dist-info/RECORD +0 -105
- nodes/actions.py +0 -70
- {arthexis-0.1.13.dist-info → arthexis-0.1.15.dist-info}/WHEEL +0 -0
- {arthexis-0.1.13.dist-info → arthexis-0.1.15.dist-info}/top_level.txt +0 -0
pages/forms.py
CHANGED
|
@@ -1,198 +1,198 @@
|
|
|
1
|
-
"""Forms for the pages app."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from django import forms
|
|
6
|
-
from django.contrib.auth import authenticate
|
|
7
|
-
from django.contrib.auth.forms import AuthenticationForm
|
|
8
|
-
from django.core.exceptions import ValidationError
|
|
9
|
-
from django.utils.translation import gettext_lazy as _
|
|
10
|
-
from django.views.decorators.debug import sensitive_variables
|
|
11
|
-
|
|
12
|
-
from core.form_fields import Base64FileField
|
|
13
|
-
|
|
14
|
-
from .models import UserManual, UserStory
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class AuthenticatorLoginForm(AuthenticationForm):
|
|
18
|
-
"""Authentication form that supports password or authenticator codes."""
|
|
19
|
-
|
|
20
|
-
otp_token = forms.CharField(
|
|
21
|
-
label=_("Authenticator code"),
|
|
22
|
-
required=False,
|
|
23
|
-
widget=forms.TextInput(
|
|
24
|
-
attrs={
|
|
25
|
-
"autocomplete": "one-time-code",
|
|
26
|
-
"inputmode": "numeric",
|
|
27
|
-
"pattern": "[0-9]*",
|
|
28
|
-
}
|
|
29
|
-
),
|
|
30
|
-
)
|
|
31
|
-
auth_method = forms.CharField(required=False, widget=forms.HiddenInput(), initial="password")
|
|
32
|
-
|
|
33
|
-
error_messages = {
|
|
34
|
-
**AuthenticationForm.error_messages,
|
|
35
|
-
"invalid_token": _("The authenticator code is invalid or has expired."),
|
|
36
|
-
"token_required": _("Enter the code from your authenticator app."),
|
|
37
|
-
"password_required": _("Enter your password."),
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
def __init__(self, request=None, *args, **kwargs):
|
|
41
|
-
super().__init__(request=request, *args, **kwargs)
|
|
42
|
-
self.fields["password"].required = False
|
|
43
|
-
self.fields["otp_token"].strip = True
|
|
44
|
-
self.fields["auth_method"].initial = "password"
|
|
45
|
-
self.verified_device = None
|
|
46
|
-
|
|
47
|
-
def get_invalid_token_error(self) -> ValidationError:
|
|
48
|
-
return ValidationError(self.error_messages["invalid_token"], code="invalid_token")
|
|
49
|
-
|
|
50
|
-
def get_token_required_error(self) -> ValidationError:
|
|
51
|
-
return ValidationError(self.error_messages["token_required"], code="token_required")
|
|
52
|
-
|
|
53
|
-
def get_password_required_error(self) -> ValidationError:
|
|
54
|
-
return ValidationError(self.error_messages["password_required"], code="password_required")
|
|
55
|
-
|
|
56
|
-
@sensitive_variables()
|
|
57
|
-
def clean(self):
|
|
58
|
-
username = self.cleaned_data.get("username")
|
|
59
|
-
method = (self.cleaned_data.get("auth_method") or "password").lower()
|
|
60
|
-
if method not in {"password", "otp"}:
|
|
61
|
-
method = "password"
|
|
62
|
-
self.cleaned_data["auth_method"] = method
|
|
63
|
-
|
|
64
|
-
if username is not None:
|
|
65
|
-
if method == "otp":
|
|
66
|
-
token = (self.cleaned_data.get("otp_token") or "").strip().replace(" ", "")
|
|
67
|
-
if not token:
|
|
68
|
-
raise self.get_token_required_error()
|
|
69
|
-
self.user_cache = authenticate(
|
|
70
|
-
self.request,
|
|
71
|
-
username=username,
|
|
72
|
-
otp_token=token,
|
|
73
|
-
)
|
|
74
|
-
if self.user_cache is None:
|
|
75
|
-
raise self.get_invalid_token_error()
|
|
76
|
-
self.cleaned_data["otp_token"] = token
|
|
77
|
-
self.verified_device = getattr(self.user_cache, "otp_device", None)
|
|
78
|
-
else:
|
|
79
|
-
password = self.cleaned_data.get("password")
|
|
80
|
-
if not password:
|
|
81
|
-
raise self.get_password_required_error()
|
|
82
|
-
self.user_cache = authenticate(
|
|
83
|
-
self.request, username=username, password=password
|
|
84
|
-
)
|
|
85
|
-
if self.user_cache is None:
|
|
86
|
-
raise self.get_invalid_login_error()
|
|
87
|
-
self.confirm_login_allowed(self.user_cache)
|
|
88
|
-
|
|
89
|
-
return self.cleaned_data
|
|
90
|
-
|
|
91
|
-
def get_verified_device(self):
|
|
92
|
-
return self.verified_device
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
class AuthenticatorEnrollmentForm(forms.Form):
|
|
96
|
-
"""Form used to confirm a pending authenticator enrollment."""
|
|
97
|
-
|
|
98
|
-
token = forms.CharField(
|
|
99
|
-
label=_("Authenticator code"),
|
|
100
|
-
min_length=6,
|
|
101
|
-
max_length=8,
|
|
102
|
-
widget=forms.TextInput(
|
|
103
|
-
attrs={
|
|
104
|
-
"autocomplete": "one-time-code",
|
|
105
|
-
"inputmode": "numeric",
|
|
106
|
-
"pattern": "[0-9]*",
|
|
107
|
-
}
|
|
108
|
-
),
|
|
109
|
-
)
|
|
110
|
-
|
|
111
|
-
error_messages = {
|
|
112
|
-
"invalid_token": _("The provided code is invalid or has expired."),
|
|
113
|
-
"missing_device": _("Generate a new authenticator secret before confirming it."),
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
def __init__(self, *args, device=None, **kwargs):
|
|
117
|
-
self.device = device
|
|
118
|
-
super().__init__(*args, **kwargs)
|
|
119
|
-
|
|
120
|
-
def clean_token(self):
|
|
121
|
-
token = (self.cleaned_data.get("token") or "").strip().replace(" ", "")
|
|
122
|
-
if not token:
|
|
123
|
-
raise forms.ValidationError(self.error_messages["invalid_token"], code="invalid_token")
|
|
124
|
-
if self.device is None:
|
|
125
|
-
raise forms.ValidationError(self.error_messages["missing_device"], code="missing_device")
|
|
126
|
-
try:
|
|
127
|
-
verified = self.device.verify_token(token)
|
|
128
|
-
except Exception:
|
|
129
|
-
verified = False
|
|
130
|
-
if not verified:
|
|
131
|
-
raise forms.ValidationError(self.error_messages["invalid_token"], code="invalid_token")
|
|
132
|
-
return token
|
|
133
|
-
|
|
134
|
-
def get_verified_device(self):
|
|
135
|
-
return self.device
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
_manual_pdf_field = UserManual._meta.get_field("content_pdf")
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
class UserManualAdminForm(forms.ModelForm):
|
|
142
|
-
content_pdf = Base64FileField(
|
|
143
|
-
label=_manual_pdf_field.verbose_name,
|
|
144
|
-
help_text=_manual_pdf_field.help_text,
|
|
145
|
-
required=not _manual_pdf_field.blank,
|
|
146
|
-
content_type="application/pdf",
|
|
147
|
-
download_name="manual.pdf",
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
class Meta:
|
|
151
|
-
model = UserManual
|
|
152
|
-
fields = "__all__"
|
|
153
|
-
|
|
154
|
-
def __init__(self, *args, **kwargs):
|
|
155
|
-
super().__init__(*args, **kwargs)
|
|
156
|
-
instance = getattr(self, "instance", None)
|
|
157
|
-
slug = getattr(instance, "slug", "")
|
|
158
|
-
if slug:
|
|
159
|
-
self.fields["content_pdf"].widget.download_name = f"{slug}.pdf"
|
|
160
|
-
self.fields["content_pdf"].widget.attrs.setdefault(
|
|
161
|
-
"accept", "application/pdf"
|
|
162
|
-
)
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
class UserStoryForm(forms.ModelForm):
|
|
166
|
-
class Meta:
|
|
167
|
-
model = UserStory
|
|
168
|
-
fields = ("name", "rating", "comments", "take_screenshot", "path")
|
|
169
|
-
widgets = {
|
|
170
|
-
"path": forms.HiddenInput(),
|
|
171
|
-
"comments": forms.Textarea(attrs={"rows": 4, "maxlength": 400}),
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
def __init__(self, *args, **kwargs):
|
|
175
|
-
super().__init__(*args, **kwargs)
|
|
176
|
-
self.fields["name"].required = False
|
|
177
|
-
self.fields["name"].widget.attrs.update(
|
|
178
|
-
{
|
|
179
|
-
"maxlength": 40,
|
|
180
|
-
"placeholder": _("Name, email or pseudonym"),
|
|
181
|
-
}
|
|
182
|
-
)
|
|
183
|
-
self.fields["take_screenshot"].initial = True
|
|
184
|
-
self.fields["rating"].widget = forms.RadioSelect(
|
|
185
|
-
choices=[(i, str(i)) for i in range(1, 6)]
|
|
186
|
-
)
|
|
187
|
-
|
|
188
|
-
def clean_comments(self):
|
|
189
|
-
comments = (self.cleaned_data.get("comments") or "").strip()
|
|
190
|
-
if len(comments) > 400:
|
|
191
|
-
raise forms.ValidationError(
|
|
192
|
-
_("Feedback must be 400 characters or fewer."), code="max_length"
|
|
193
|
-
)
|
|
194
|
-
return comments
|
|
195
|
-
|
|
196
|
-
def clean_name(self):
|
|
197
|
-
name = (self.cleaned_data.get("name") or "").strip()
|
|
198
|
-
return name[:40]
|
|
1
|
+
"""Forms for the pages app."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from django import forms
|
|
6
|
+
from django.contrib.auth import authenticate
|
|
7
|
+
from django.contrib.auth.forms import AuthenticationForm
|
|
8
|
+
from django.core.exceptions import ValidationError
|
|
9
|
+
from django.utils.translation import gettext_lazy as _
|
|
10
|
+
from django.views.decorators.debug import sensitive_variables
|
|
11
|
+
|
|
12
|
+
from core.form_fields import Base64FileField
|
|
13
|
+
|
|
14
|
+
from .models import UserManual, UserStory
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class AuthenticatorLoginForm(AuthenticationForm):
|
|
18
|
+
"""Authentication form that supports password or authenticator codes."""
|
|
19
|
+
|
|
20
|
+
otp_token = forms.CharField(
|
|
21
|
+
label=_("Authenticator code"),
|
|
22
|
+
required=False,
|
|
23
|
+
widget=forms.TextInput(
|
|
24
|
+
attrs={
|
|
25
|
+
"autocomplete": "one-time-code",
|
|
26
|
+
"inputmode": "numeric",
|
|
27
|
+
"pattern": "[0-9]*",
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
)
|
|
31
|
+
auth_method = forms.CharField(required=False, widget=forms.HiddenInput(), initial="password")
|
|
32
|
+
|
|
33
|
+
error_messages = {
|
|
34
|
+
**AuthenticationForm.error_messages,
|
|
35
|
+
"invalid_token": _("The authenticator code is invalid or has expired."),
|
|
36
|
+
"token_required": _("Enter the code from your authenticator app."),
|
|
37
|
+
"password_required": _("Enter your password."),
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
def __init__(self, request=None, *args, **kwargs):
|
|
41
|
+
super().__init__(request=request, *args, **kwargs)
|
|
42
|
+
self.fields["password"].required = False
|
|
43
|
+
self.fields["otp_token"].strip = True
|
|
44
|
+
self.fields["auth_method"].initial = "password"
|
|
45
|
+
self.verified_device = None
|
|
46
|
+
|
|
47
|
+
def get_invalid_token_error(self) -> ValidationError:
|
|
48
|
+
return ValidationError(self.error_messages["invalid_token"], code="invalid_token")
|
|
49
|
+
|
|
50
|
+
def get_token_required_error(self) -> ValidationError:
|
|
51
|
+
return ValidationError(self.error_messages["token_required"], code="token_required")
|
|
52
|
+
|
|
53
|
+
def get_password_required_error(self) -> ValidationError:
|
|
54
|
+
return ValidationError(self.error_messages["password_required"], code="password_required")
|
|
55
|
+
|
|
56
|
+
@sensitive_variables()
|
|
57
|
+
def clean(self):
|
|
58
|
+
username = self.cleaned_data.get("username")
|
|
59
|
+
method = (self.cleaned_data.get("auth_method") or "password").lower()
|
|
60
|
+
if method not in {"password", "otp"}:
|
|
61
|
+
method = "password"
|
|
62
|
+
self.cleaned_data["auth_method"] = method
|
|
63
|
+
|
|
64
|
+
if username is not None:
|
|
65
|
+
if method == "otp":
|
|
66
|
+
token = (self.cleaned_data.get("otp_token") or "").strip().replace(" ", "")
|
|
67
|
+
if not token:
|
|
68
|
+
raise self.get_token_required_error()
|
|
69
|
+
self.user_cache = authenticate(
|
|
70
|
+
self.request,
|
|
71
|
+
username=username,
|
|
72
|
+
otp_token=token,
|
|
73
|
+
)
|
|
74
|
+
if self.user_cache is None:
|
|
75
|
+
raise self.get_invalid_token_error()
|
|
76
|
+
self.cleaned_data["otp_token"] = token
|
|
77
|
+
self.verified_device = getattr(self.user_cache, "otp_device", None)
|
|
78
|
+
else:
|
|
79
|
+
password = self.cleaned_data.get("password")
|
|
80
|
+
if not password:
|
|
81
|
+
raise self.get_password_required_error()
|
|
82
|
+
self.user_cache = authenticate(
|
|
83
|
+
self.request, username=username, password=password
|
|
84
|
+
)
|
|
85
|
+
if self.user_cache is None:
|
|
86
|
+
raise self.get_invalid_login_error()
|
|
87
|
+
self.confirm_login_allowed(self.user_cache)
|
|
88
|
+
|
|
89
|
+
return self.cleaned_data
|
|
90
|
+
|
|
91
|
+
def get_verified_device(self):
|
|
92
|
+
return self.verified_device
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class AuthenticatorEnrollmentForm(forms.Form):
|
|
96
|
+
"""Form used to confirm a pending authenticator enrollment."""
|
|
97
|
+
|
|
98
|
+
token = forms.CharField(
|
|
99
|
+
label=_("Authenticator code"),
|
|
100
|
+
min_length=6,
|
|
101
|
+
max_length=8,
|
|
102
|
+
widget=forms.TextInput(
|
|
103
|
+
attrs={
|
|
104
|
+
"autocomplete": "one-time-code",
|
|
105
|
+
"inputmode": "numeric",
|
|
106
|
+
"pattern": "[0-9]*",
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
error_messages = {
|
|
112
|
+
"invalid_token": _("The provided code is invalid or has expired."),
|
|
113
|
+
"missing_device": _("Generate a new authenticator secret before confirming it."),
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
def __init__(self, *args, device=None, **kwargs):
|
|
117
|
+
self.device = device
|
|
118
|
+
super().__init__(*args, **kwargs)
|
|
119
|
+
|
|
120
|
+
def clean_token(self):
|
|
121
|
+
token = (self.cleaned_data.get("token") or "").strip().replace(" ", "")
|
|
122
|
+
if not token:
|
|
123
|
+
raise forms.ValidationError(self.error_messages["invalid_token"], code="invalid_token")
|
|
124
|
+
if self.device is None:
|
|
125
|
+
raise forms.ValidationError(self.error_messages["missing_device"], code="missing_device")
|
|
126
|
+
try:
|
|
127
|
+
verified = self.device.verify_token(token)
|
|
128
|
+
except Exception:
|
|
129
|
+
verified = False
|
|
130
|
+
if not verified:
|
|
131
|
+
raise forms.ValidationError(self.error_messages["invalid_token"], code="invalid_token")
|
|
132
|
+
return token
|
|
133
|
+
|
|
134
|
+
def get_verified_device(self):
|
|
135
|
+
return self.device
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
_manual_pdf_field = UserManual._meta.get_field("content_pdf")
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class UserManualAdminForm(forms.ModelForm):
|
|
142
|
+
content_pdf = Base64FileField(
|
|
143
|
+
label=_manual_pdf_field.verbose_name,
|
|
144
|
+
help_text=_manual_pdf_field.help_text,
|
|
145
|
+
required=not _manual_pdf_field.blank,
|
|
146
|
+
content_type="application/pdf",
|
|
147
|
+
download_name="manual.pdf",
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
class Meta:
|
|
151
|
+
model = UserManual
|
|
152
|
+
fields = "__all__"
|
|
153
|
+
|
|
154
|
+
def __init__(self, *args, **kwargs):
|
|
155
|
+
super().__init__(*args, **kwargs)
|
|
156
|
+
instance = getattr(self, "instance", None)
|
|
157
|
+
slug = getattr(instance, "slug", "")
|
|
158
|
+
if slug:
|
|
159
|
+
self.fields["content_pdf"].widget.download_name = f"{slug}.pdf"
|
|
160
|
+
self.fields["content_pdf"].widget.attrs.setdefault(
|
|
161
|
+
"accept", "application/pdf"
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
class UserStoryForm(forms.ModelForm):
|
|
166
|
+
class Meta:
|
|
167
|
+
model = UserStory
|
|
168
|
+
fields = ("name", "rating", "comments", "take_screenshot", "path")
|
|
169
|
+
widgets = {
|
|
170
|
+
"path": forms.HiddenInput(),
|
|
171
|
+
"comments": forms.Textarea(attrs={"rows": 4, "maxlength": 400}),
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
def __init__(self, *args, **kwargs):
|
|
175
|
+
super().__init__(*args, **kwargs)
|
|
176
|
+
self.fields["name"].required = False
|
|
177
|
+
self.fields["name"].widget.attrs.update(
|
|
178
|
+
{
|
|
179
|
+
"maxlength": 40,
|
|
180
|
+
"placeholder": _("Name, email or pseudonym"),
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
self.fields["take_screenshot"].initial = True
|
|
184
|
+
self.fields["rating"].widget = forms.RadioSelect(
|
|
185
|
+
choices=[(i, str(i)) for i in range(1, 6)]
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
def clean_comments(self):
|
|
189
|
+
comments = (self.cleaned_data.get("comments") or "").strip()
|
|
190
|
+
if len(comments) > 400:
|
|
191
|
+
raise forms.ValidationError(
|
|
192
|
+
_("Feedback must be 400 characters or fewer."), code="max_length"
|
|
193
|
+
)
|
|
194
|
+
return comments
|
|
195
|
+
|
|
196
|
+
def clean_name(self):
|
|
197
|
+
name = (self.cleaned_data.get("name") or "").strip()
|
|
198
|
+
return name[:40]
|