From 9d9de6b2a3b7d6f046f5ee1c01a8944044d48979 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 2 May 2017 14:48:44 -0400 Subject: [PATCH] Fixes #1126: Fix error when editing a user key via admin UI --- netbox/secrets/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/secrets/admin.py b/netbox/secrets/admin.py index 1dbe6173e..990f3ffc7 100644 --- a/netbox/secrets/admin.py +++ b/netbox/secrets/admin.py @@ -2,7 +2,7 @@ from django.contrib import admin, messages from django.shortcuts import redirect, render from .forms import ActivateUserKeyForm -from .models import UserKey, SecretRole, Secret +from .models import UserKey @admin.register(UserKey) @@ -10,7 +10,7 @@ class UserKeyAdmin(admin.ModelAdmin): actions = ['activate_selected'] list_display = ['user', 'is_filled', 'is_active', 'created'] fields = ['user', 'public_key', 'is_active', 'last_updated'] - readonly_fields = ['is_active', 'last_updated'] + readonly_fields = ['user', 'is_active', 'last_updated'] def get_readonly_fields(self, request, obj=None): # Don't allow a user to modify an existing public key directly.