Skip to content

Commit f4b587e

Browse files
Merge pull request #14365 from AlexVelezLl/picture_password_field
Add new picture_password field to FacilityUser
2 parents f2b7b51 + 7a4b40f commit f4b587e

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 3.2.25 on 2026-03-11 18:56
2+
from django.db import migrations
3+
from django.db import models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("kolibriauth", "0032_alter_facilityuser_managers"),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name="facilityuser",
15+
name="picture_password",
16+
field=models.CharField(blank=True, default=None, max_length=8, null=True),
17+
),
18+
migrations.AlterUniqueTogether(
19+
name="facilityuser",
20+
unique_together={("dataset", "picture_password")},
21+
),
22+
]

kolibri/core/auth/models.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,18 @@ class FacilityUser(AbstractBaseUser, KolibriBaseUserMixin, AbstractFacilityDataM
911911

912912
date_deleted = DateTimeTzField(null=True, blank=True)
913913

914+
# This field is used when picture login for learners is enabled. It stores the ordered
915+
# picture sequence as a dot-separated string, e.g. "3.7.12". This field is only
916+
# applicable to learners, so coach and admin users will never have this field set.
917+
# The field is intentionally stored as plaintext, because coaches should be able to see
918+
# learner passcodes.
919+
picture_password = models.CharField(
920+
max_length=8, null=True, blank=True, default=None
921+
)
922+
923+
class Meta:
924+
unique_together = (("dataset", "picture_password"),)
925+
914926
def get_short_name(self):
915927
return self.full_name.split(" ", 1)[0]
916928

0 commit comments

Comments
 (0)