0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Add dismissibles field to UserProfile model

This commit is contained in:
Sage Abdullah 2022-10-13 12:25:43 +01:00 committed by Thibaud Colas
parent 34a79d36ad
commit a70ae4844a
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 4.0.5 on 2022-10-06 15:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtailusers", "0010_userprofile_updated_comments_notifications"),
]
operations = [
migrations.AddField(
model_name="userprofile",
name="dismissibles",
field=models.JSONField(blank=True, default=dict),
),
]

View File

@ -70,6 +70,8 @@ class UserProfile(models.Model):
blank=True,
)
dismissibles = models.JSONField(default=dict, blank=True)
@classmethod
def get_for_user(cls, user):
return cls.objects.get_or_create(user=user)[0]