1
0
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:
Jeremy Stretch
2016-06-14 16:25:18 -04:00
parent a3e64a9964
commit c149dd2bd0
2 changed files with 20 additions and 0 deletions

View File

@ -195,6 +195,7 @@ class Secret(models.Model):
class Meta:
ordering = ['device', 'role', 'name']
unique_together = ['device', 'role', 'name']
def __init__(self, *args, **kwargs):
self.plaintext = kwargs.pop('plaintext', None)