Skip to content

Commit

Permalink
refactor: Set default values for bug_type and status fields in Bug model
Browse files Browse the repository at this point in the history
  • Loading branch information
albertoleoncio committed Aug 8, 2024
1 parent 866a3dc commit 6bb9847
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions bugs/migrations/0002_alter_bug_bug_type_alter_bug_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.11 on 2024-08-08 18:47

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('bugs', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='bug',
name='bug_type',
field=models.CharField(blank=True, choices=[('error', 'Error'), ('new_feature', 'New Feature'), ('improvement', 'Improvement'), ('test_case', 'Test Case')], default='error', max_length=20),
),
migrations.AlterField(
model_name='bug',
name='status',
field=models.CharField(blank=True, choices=[('to_do', 'To Do'), ('assigned', 'Assigned'), ('in_progress', 'In Progress'), ('under_review', 'Under Review'), ('done', 'Done')], default='to_do', max_length=20),
),
]
4 changes: 2 additions & 2 deletions bugs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class Bug(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
title = models.CharField(max_length=200)
description = models.TextField(max_length=1000)
bug_type = models.CharField(choices=BUG_TYPES, max_length=20, blank=True, null=True)
status = models.CharField(choices=BUG_STATUSES, max_length=20, blank=True, null=True)
bug_type = models.CharField(choices=BUG_TYPES, max_length=20, blank=True, default="error")
status = models.CharField(choices=BUG_STATUSES, max_length=20, blank=True, default="to_do")
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)

Expand Down

0 comments on commit 6bb9847

Please sign in to comment.