Skip to content

Commit 24ea052

Browse files
committed
[fix] Fixes QA issues
1 parent d264d7a commit 24ea052

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

openwisp_radius/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,8 @@ def get_unique_error_message(self, unique_check):
547547
# domain-specific, user-friendly error that matches our constraint.
548548
if unique_check == ("user", "organization"):
549549
return _(
550-
"A user cannot have more than one registration record in the same organization."
550+
"A user cannot have more than one registration record in the"
551+
" same organization."
551552
)
552553

553554

openwisp_radius/tests/test_migrations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def test_multitenant_reverse_method_priority_ordering(self):
317317
org3 = self._create_org(name="method-org-3", slug="method-org-3")
318318
modified_base = timezone.now()
319319
# All unverified, same timestamp - method should decide
320-
org_empty = RegisteredUser.objects.create(
320+
RegisteredUser.objects.create(
321321
user=user,
322322
organization=org1,
323323
is_verified=False,

tests/openwisp2/sample_radius/migrations/0032_registered_user_multitenant.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ class Migration(migrations.Migration):
207207
constraint=models.UniqueConstraint(
208208
fields=["user", "organization"],
209209
name="unique_registered_user_per_org",
210+
violation_error_message=(
211+
"A user cannot have more than one registration"
212+
" record in the same organization."
213+
),
210214
),
211215
),
212216
migrations.AddConstraint(
@@ -215,6 +219,10 @@ class Migration(migrations.Migration):
215219
fields=["user"],
216220
condition=models.Q(organization__isnull=True),
217221
name="unique_global_registered_user",
222+
violation_error_message=(
223+
"A user cannot have more than one registration"
224+
" record in the same organization."
225+
),
218226
),
219227
),
220228
]

0 commit comments

Comments
 (0)