1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Import unicode_literals

This commit is contained in:
Jeremy Stretch
2017-05-24 11:33:11 -04:00
parent 9aad8a7774
commit f21c6bca00
109 changed files with 320 additions and 131 deletions

View File

@ -1,3 +1,5 @@
from __future__ import unicode_literals
from django.contrib import admin, messages
from django.shortcuts import redirect, render
@ -34,7 +36,7 @@ class UserKeyAdmin(admin.ModelAdmin):
try:
my_userkey = UserKey.objects.get(user=request.user)
except UserKey.DoesNotExist:
messages.error(request, u"You do not have an active User Key.")
messages.error(request, "You do not have an active User Key.")
return redirect('admin:secrets_userkey_changelist')
if 'activate' in request.POST:
@ -46,7 +48,7 @@ class UserKeyAdmin(admin.ModelAdmin):
uk.activate(master_key)
return redirect('admin:secrets_userkey_changelist')
except ValueError:
messages.error(request, u"Invalid private key provided. Unable to retrieve master key.")
messages.error(request, "Invalid private key provided. Unable to retrieve master key.")
else:
form = ActivateUserKeyForm(initial={'_selected_action': request.POST.getlist(admin.ACTION_CHECKBOX_NAME)})