mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-14 12:29:35 -06:00
Misc cleanup
This commit is contained in:
parent
d69042f26e
commit
a54c508da2
@ -345,11 +345,9 @@ class UserTokenView(LoginRequiredMixin, View):
|
|||||||
|
|
||||||
def get(self, request, pk):
|
def get(self, request, pk):
|
||||||
token = get_object_or_404(UserToken.objects.filter(user=request.user), pk=pk)
|
token = get_object_or_404(UserToken.objects.filter(user=request.user), pk=pk)
|
||||||
key = token.key if token.v2 or settings.ALLOW_TOKEN_RETRIEVAL else None
|
|
||||||
|
|
||||||
return render(request, 'account/token.html', {
|
return render(request, 'account/token.html', {
|
||||||
'object': token,
|
'object': token,
|
||||||
'key': key,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ __all__ = (
|
|||||||
'UserTable',
|
'UserTable',
|
||||||
)
|
)
|
||||||
|
|
||||||
TOKEN = """<samp><span id="token_{{ record.pk }}">{{ record }}</span></samp>"""
|
TOKEN = """<samp><a href="{{ record.get_absolute_url }}" id="token_{{ record.pk }}">{{ record }}</a></samp>"""
|
||||||
|
|
||||||
COPY_BUTTON = """
|
COPY_BUTTON = """
|
||||||
{% if settings.ALLOW_TOKEN_RETRIEVAL %}
|
{% if settings.ALLOW_TOKEN_RETRIEVAL %}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user