fix(core): required field must be null for logical chek to function

ref: #873 #768
This commit is contained in:
2025-07-23 09:50:00 +09:30
parent 68084d8a05
commit 7392c9700d
4 changed files with 50 additions and 7 deletions

View File

@ -0,0 +1,42 @@
# Generated by Django 5.1.10 on 2025-07-23 00:04
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("contenttypes", "0002_remove_content_type_name"),
("core", "0036_alter_ticketbase_external_ref_and_more"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.AlterField(
model_name="centurionmodelnote",
name="content_type",
field=models.ForeignKey(
blank=True,
help_text="Model this note is for",
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="contenttypes.contenttype",
verbose_name="Content Model",
),
),
migrations.AlterField(
model_name="centurionmodelnote",
name="created_by",
field=models.ForeignKey(
blank=True,
help_text="User whom added the Note",
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="+",
to=settings.AUTH_USER_MODEL,
verbose_name="Created By",
),
),
]

View File

@ -53,7 +53,7 @@ class CenturionModelNote(
settings.AUTH_USER_MODEL,
blank = True,
help_text = 'User whom added the Note',
null = False,
null = True,
on_delete = models.PROTECT,
related_name = '+',
verbose_name = 'Created By',
@ -75,7 +75,7 @@ class CenturionModelNote(
ContentType,
blank = True,
help_text = 'Model this note is for',
null = False,
null = True,
on_delete=models.CASCADE,
verbose_name = 'Content Model'
)

View File

@ -50,7 +50,7 @@ class CenturionNoteModelTestCases(
'blank': True,
'default': models.fields.NOT_PROVIDED,
'field_type': models.ForeignKey,
'null': False,
'null': True,
'unique': False,
},
'modified_by': {
@ -64,7 +64,7 @@ class CenturionNoteModelTestCases(
'blank': True,
'default': models.fields.NOT_PROVIDED,
'field_type': models.ForeignKey,
'null': False,
'null': True,
'unique': False,
},
'modified': {