Skip to content

Commit

Permalink
Set catalog null on deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Jun 1, 2018
1 parent d94c897 commit 723088d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions rdmo/projects/migrations/0016_catalog_on_delete.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2018-06-01 08:33
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

dependencies = [
('projects', '0015_permissions'),
]

operations = [
migrations.AlterField(
model_name='project',
name='catalog',
field=models.ForeignKey(help_text='The catalog which will be used for this project.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='questions.Catalog', verbose_name='Catalog'),
),
]
2 changes: 1 addition & 1 deletion rdmo/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Project(Model):
help_text=_('A description for this project (optional).')
)
catalog = models.ForeignKey(
Catalog, related_name='+',
Catalog, related_name='+', on_delete=models.SET_NULL, null=True,
verbose_name=_('Catalog'),
help_text=_('The catalog which will be used for this project.')
)
Expand Down

0 comments on commit 723088d

Please sign in to comment.