Skip to content

Commit c9d77b6

Browse files
committed
chore(model): add slack user id in admin panel.
This commit adds the `slack_user_id` field to the Django admin panel for the User model. The field is now configured to be blankable but not nullable, which is the opposite of its previous configuration.
1 parent df45f9d commit c9d77b6

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

apps/user/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class UserAdmin(DjangoUserAdmin): # type: ignore[reportMissingTypeArgument]
4949
"last_name",
5050
"display_name",
5151
"contributor_user",
52+
"slack_user_id",
5253
),
5354
},
5455
),
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 5.2.5 on 2025-10-08 08:47
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('user', '0002_user_slack_user_id'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='user',
15+
name='slack_user_id',
16+
field=models.CharField(blank=True, max_length=20),
17+
),
18+
]

apps/user/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class User(AbstractUser):
4343
)
4444

4545
objects: CustomUserManager = CustomUserManager() # type: ignore[reportAssignmentType]
46-
slack_user_id = models.CharField(max_length=20, null=True, blank=False)
46+
slack_user_id = models.CharField(max_length=20, null=False, blank=True)
4747

4848
# type hints
4949
pk: int

0 commit comments

Comments
 (0)