Skip to content

Commit

Permalink
Merge pull request #1326 from glogiotatidis/issue-1310-product-field
Browse files Browse the repository at this point in the history
[Fix #1310] Make product ForeignKey not null.
  • Loading branch information
glogiotatidis committed Feb 21, 2020
2 parents 59fa454 + b1e77da commit 5e30c92
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
19 changes: 19 additions & 0 deletions snippets/base/migrations/0032_auto_20200221_1312.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 2.2.6 on 2020-02-21 13:12

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('base', '0031_auto_20200219_0949'),
]

operations = [
migrations.AlterField(
model_name='asrsnippet',
name='product',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='snippets', to='base.Product'),
),
]
3 changes: 1 addition & 2 deletions snippets/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2052,8 +2052,7 @@ class ASRSnippet(models.Model):
name = models.CharField(max_length=255, unique=True)

category = models.ForeignKey(Category, on_delete=models.PROTECT, related_name='snippets')
product = models.ForeignKey(Product, null=True, on_delete=models.PROTECT,
related_name='snippets')
product = models.ForeignKey(Product, on_delete=models.PROTECT, related_name='snippets')

tags = TaggableManager(blank=True)

Expand Down

0 comments on commit 5e30c92

Please sign in to comment.