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:
parent
34a79d36ad
commit
a70ae4844a
18
wagtail/users/migrations/0011_userprofile_dismissibles.py
Normal file
18
wagtail/users/migrations/0011_userprofile_dismissibles.py
Normal 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),
|
||||
),
|
||||
]
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user