Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Sep 27, 2024
1 parent d65d49c commit 36e6f72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions codeforlife/user/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 3.2.24 on 2024-04-15 10:04
# Generated by Django 3.2.25 on 2024-09-27 10:06

import codeforlife.user.models.user
import django.contrib.auth.models
Expand All @@ -12,7 +12,7 @@ class Migration(migrations.Migration):

dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
('common', '0048_unique_school_names'),
('common', '0054_delete_aimmo_models'),
]

operations = [
Expand Down Expand Up @@ -81,7 +81,7 @@ class Migration(migrations.Migration):
name='OtpBypassToken',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('token', models.CharField(max_length=8, verbose_name='token')),
('token', models.CharField(help_text='The hashed equivalent of the token.', max_length=88, verbose_name='token')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='otp_bypass_tokens', to='user.user')),
],
options={
Expand Down
3 changes: 2 additions & 1 deletion codeforlife/user/models/otp_bypass_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def bulk_create(self, user: User): # type: ignore[override]

token = models.CharField(
_("token"),
max_length=length,
max_length=88,
help_text=_("The hashed equivalent of the token."),
)

class Meta(TypedModelMeta):
Expand Down
4 changes: 2 additions & 2 deletions codeforlife/user/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def get_queryset(
new_student__class_field=user.student.class_field
)

return teachers | students
return (teachers | students).order_by("pk")

user = self.request.teacher_user
if user.teacher.school:
Expand Down Expand Up @@ -66,7 +66,7 @@ def get_queryset(
)
)

return teachers | students | independents
return (teachers | students | independents).order_by("pk")

return user_class.objects.filter(pk=user.pk)

Expand Down

0 comments on commit 36e6f72

Please sign in to comment.