mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Added uniquieness constraint to Secret
This commit is contained in:
19
netbox/secrets/migrations/0005_auto_20160614_2019.py
Normal file
19
netbox/secrets/migrations/0005_auto_20160614_2019.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.9.5 on 2016-06-14 20:19
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('secrets', '0004_auto_20160407_1548'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterUniqueTogether(
|
||||||
|
name='secret',
|
||||||
|
unique_together=set([('device', 'role', 'name')]),
|
||||||
|
),
|
||||||
|
]
|
@ -195,6 +195,7 @@ class Secret(models.Model):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['device', 'role', 'name']
|
ordering = ['device', 'role', 'name']
|
||||||
|
unique_together = ['device', 'role', 'name']
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.plaintext = kwargs.pop('plaintext', None)
|
self.plaintext = kwargs.pop('plaintext', None)
|
||||||
|
Reference in New Issue
Block a user