diff --git a/src/ralph/networks/migrations/0010_auto_20170216_1230.py b/src/ralph/networks/migrations/0010_auto_20170216_1230.py new file mode 100644 index 0000000000..0fb114654c --- /dev/null +++ b/src/ralph/networks/migrations/0010_auto_20170216_1230.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('networks', '0009_auto_20160823_0921'), + ] + + operations = [ + migrations.AlterField( + model_name='network', + name='gateway', + field=models.ForeignKey(to='networks.IPAddress', blank=True, on_delete=django.db.models.deletion.SET_NULL, verbose_name='Gateway address', null=True, related_name='gateway_network'), + ), + ] diff --git a/src/ralph/networks/models/networks.py b/src/ralph/networks/models/networks.py index 13f559847c..226a007043 100644 --- a/src/ralph/networks/models/networks.py +++ b/src/ralph/networks/models/networks.py @@ -234,7 +234,7 @@ class Network( address._filter_title = _('Network Class') gateway = models.ForeignKey( 'IPAddress', verbose_name=_('Gateway address'), null=True, blank=True, - related_name='gateway_network' + related_name='gateway_network', on_delete=models.SET_NULL, ) remarks = models.TextField( verbose_name=_('remarks'),