Skip to content

Commit fa6b7f2

Browse files
committed
Fix default function for label colors at learn section
1 parent 71e6260 commit fa6b7f2

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Generated by Django 3.2.13 on 2022-06-23 08:11
2+
3+
import apps.learn.colors
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('learn', '0004_alter_label_color'),
11+
]
12+
13+
operations = [
14+
migrations.AlterField(
15+
model_name='label',
16+
name='color',
17+
field=models.CharField(default=apps.learn.colors.get_random_hex_color, max_length=8),
18+
),
19+
]

apps/learn/models.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ class Meta:
1212
name = models.CharField(max_length=120)
1313
slug = models.SlugField(max_length=120, unique=True)
1414
# Label color in hex mode
15-
color = models.CharField(
16-
max_length=8, default=colors.get_random_hex_color()
17-
)
15+
color = models.CharField(max_length=8, default=colors.get_random_hex_color)
1816

1917
def __str__(self):
2018
return self.name

0 commit comments

Comments
 (0)