dev: add imports for back migration and add migration for views (#707)

This commit is contained in:
pablohashescobar 2023-04-06 13:59:43 +05:30 committed by GitHub
parent 6a579f85ad
commit 86ec46db2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 5 deletions

View File

@ -3,8 +3,7 @@ import uuid
import random
from django.contrib.auth.hashers import make_password
from plane.db.models import ProjectIdentifier
from plane.db.models import Issue, IssueComment, User, Project, ProjectMember
from plane.db.models import Issue, IssueComment, User, Project, ProjectMember, Label
# Update description and description html values for old descriptions
@ -148,7 +147,7 @@ def update_user_view_property():
"collapsed": True,
"issueView": "list",
"filterIssue": None,
"groupByProperty": True,
"groupByProperty": None,
"showEmptyGroups": True,
}
updated_project_members.append(project_member)
@ -161,6 +160,7 @@ def update_user_view_property():
print(e)
print("Failed")
def update_label_color():
try:
labels = Label.objects.filter(color="")

View File

@ -0,0 +1,19 @@
# Generated by Django 3.2.18 on 2023-04-04 21:50
from django.db import migrations, models
import plane.db.models.project
class Migration(migrations.Migration):
dependencies = [
('db', '0025_auto_20230331_0203'),
]
operations = [
migrations.AlterField(
model_name='projectmember',
name='view_props',
field=models.JSONField(default=plane.db.models.project.get_default_props),
),
]

View File

@ -26,7 +26,7 @@ def get_default_props():
"collapsed": True,
"issueView": "list",
"filterIssue": None,
"groupByProperty": True,
"groupByProperty": None,
"showEmptyGroups": True,
}
@ -133,7 +133,7 @@ class ProjectMember(ProjectBaseModel):
)
comment = models.TextField(blank=True, null=True)
role = models.PositiveSmallIntegerField(choices=ROLE_CHOICES, default=10)
view_props = models.JSONField(null=True)
view_props = models.JSONField(default=get_default_props)
default_props = models.JSONField(default=get_default_props)
class Meta: