diff --git a/netbox/templates/users/userkey.html b/netbox/templates/users/userkey.html
index 53c8cdc39..09b5bde5b 100644
--- a/netbox/templates/users/userkey.html
+++ b/netbox/templates/users/userkey.html
@@ -3,7 +3,7 @@
{% block title %}User Key{% endblock %}
{% block usercontent %}
- {% if userkey %}
+ {% if object %}
Your user key is:
- {% if userkey.is_active %}
+ {% if object.is_active %}
Active
{% else %}
Inactive
{% endif %}
- {% include 'inc/created_updated.html' with obj=userkey %}
- {% if not userkey.is_active %}
+ {% include 'inc/created_updated.html' %}
+ {% if not object.is_active %}
Your user key is inactive. Ask an administrator to enable it for you.
{% endif %}
- {{ userkey.public_key }}
+ {{ object.public_key }}
- {% if userkey.session_key %}
+ {% if object.session_key %}
Session key: Active
- Created {{ userkey.session_key.created }}
+ Created {{ object.session_key.created }}
{% else %}
No active session key
{% endif %}
diff --git a/netbox/templates/users/userkey_edit.html b/netbox/templates/users/userkey_edit.html
index 0715f9038..a7aaa720c 100644
--- a/netbox/templates/users/userkey_edit.html
+++ b/netbox/templates/users/userkey_edit.html
@@ -5,7 +5,7 @@
{% block title %}User Key{% endblock %}
{% block usercontent %}
- {% if userkey.is_active %}
+ {% if object.is_active %}
Warning: Changing your public key will require your user key to be re-activated by another
user. You will be unable to retrieve any secrets until your key has been reactivated.
diff --git a/netbox/users/views.py b/netbox/users/views.py
index 21a6c3395..a6d28ecd2 100644
--- a/netbox/users/views.py
+++ b/netbox/users/views.py
@@ -185,7 +185,7 @@ class UserKeyView(LoginRequiredMixin, View):
userkey = None
return render(request, self.template_name, {
- 'userkey': userkey,
+ 'object': userkey,
'active_tab': 'userkey',
})
@@ -205,7 +205,7 @@ class UserKeyEditView(LoginRequiredMixin, View):
form = UserKeyForm(instance=self.userkey)
return render(request, self.template_name, {
- 'userkey': self.userkey,
+ 'object': self.userkey,
'form': form,
'active_tab': 'userkey',
})