mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-25 15:45:23 +00:00
replaced ugettext_lazy with gettext_lazy
This commit is contained in:
parent
5172a9f619
commit
1b3fd9d05e
23 changed files with 40 additions and 39 deletions
|
@ -1,7 +1,7 @@
|
||||||
from appsettings.settings import app_settings
|
from appsettings.settings import app_settings
|
||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
from django.forms import ModelForm, ValidationError
|
from django.forms import ModelForm, ValidationError
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from .models import UserInstance, UserSSHKey
|
from .models import UserInstance, UserSSHKey
|
||||||
from .utils import validate_ssh_key
|
from .utils import validate_ssh_key
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.core.validators import MinValueValidator
|
from django.core.validators import MinValueValidator
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from instances.models import Instance
|
from instances.models import Instance
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ from django.contrib.auth.models import Group, User
|
||||||
from django.contrib.auth.forms import ReadOnlyPasswordHashField
|
from django.contrib.auth.forms import ReadOnlyPasswordHashField
|
||||||
from django.urls import reverse_lazy
|
from django.urls import reverse_lazy
|
||||||
from django.utils.text import format_lazy
|
from django.utils.text import format_lazy
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from accounts.models import UserAttributes
|
from accounts.models import UserAttributes
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ from django.contrib.auth.forms import AdminPasswordChangeForm
|
||||||
from django.contrib.auth.models import Group, User
|
from django.contrib.auth.models import Group, User
|
||||||
from django.core.paginator import Paginator
|
from django.core.paginator import Paginator
|
||||||
from django.shortcuts import get_object_or_404, redirect, render
|
from django.shortcuts import get_object_or_404, redirect, render
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from accounts.models import UserAttributes, UserInstance, Instance
|
from accounts.models import UserAttributes, UserInstance, Instance
|
||||||
from appsettings.settings import app_settings
|
from appsettings.settings import app_settings
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
# Generated by Django 2.2.12 on 2020-05-23 12:05
|
# Generated by Django 2.2.12 on 2020-05-23 12:05
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
def add_default_settings(apps, schema_editor):
|
def add_default_settings(apps, schema_editor):
|
||||||
setting = apps.get_model("appsettings", "AppSettings")
|
setting = apps.get_model("appsettings", "AppSettings")
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Generated by Django 2.2.13 on 2020-07-16 06:37
|
# Generated by Django 2.2.13 on 2020-07-16 06:37
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
def add_default_settings(apps, schema_editor):
|
def add_default_settings(apps, schema_editor):
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class AppSettings(models.Model):
|
class AppSettings(models.Model):
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import os
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.http import HttpResponseRedirect
|
from django.http import HttpResponseRedirect
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
|
|
||||||
|
@ -90,4 +90,3 @@ def appsettings(request):
|
||||||
return HttpResponseRedirect(request.get_full_path())
|
return HttpResponseRedirect(request.get_full_path())
|
||||||
|
|
||||||
return render(request, 'appsettings.html', locals())
|
return render(request, 'appsettings.html', locals())
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import re
|
import re
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from computes.models import Compute
|
from computes.models import Compute
|
||||||
from vrtManager.connection import CONN_TCP, CONN_SSH, CONN_TLS, CONN_SOCKET
|
from vrtManager.connection import CONN_TCP, CONN_SSH, CONN_TLS, CONN_SOCKET
|
||||||
from .validators import validate_hostname
|
from .validators import validate_hostname
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from django.db.models import CharField, IntegerField, Model
|
from django.db.models import CharField, IntegerField, Model
|
||||||
from django.utils.functional import cached_property
|
from django.utils.functional import cached_property
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from libvirt import virConnect
|
from libvirt import virConnect
|
||||||
|
|
||||||
from vrtManager.connection import connection_manager
|
from vrtManager.connection import connection_manager
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
import re
|
import re
|
||||||
|
|
||||||
have_symbol = re.compile('[^a-zA-Z0-9._-]+')
|
have_symbol = re.compile('[^a-zA-Z0-9._-]+')
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from appsettings.models import AppSettings
|
from appsettings.models import AppSettings
|
||||||
from webvirtcloud.settings import QEMU_CONSOLE_LISTEN_ADDRESSES, QEMU_KEYMAPS
|
from webvirtcloud.settings import QEMU_CONSOLE_LISTEN_ADDRESSES, QEMU_KEYMAPS
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.functional import cached_property
|
from django.utils.functional import cached_property
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from libvirt import VIR_DOMAIN_XML_SECURE
|
from libvirt import VIR_DOMAIN_XML_SECURE
|
||||||
|
|
||||||
from computes.models import Compute
|
from computes.models import Compute
|
||||||
|
|
|
@ -5,7 +5,7 @@ from collections import OrderedDict
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from accounts.models import UserInstance
|
from accounts.models import UserInstance
|
||||||
from appsettings.settings import app_settings
|
from appsettings.settings import app_settings
|
||||||
|
|
|
@ -18,7 +18,7 @@ from django.contrib.auth.models import User
|
||||||
from django.http import Http404, HttpResponse, JsonResponse
|
from django.http import Http404, HttpResponse, JsonResponse
|
||||||
from django.shortcuts import get_object_or_404, redirect, render
|
from django.shortcuts import get_object_or_404, redirect, render
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from libvirt import (VIR_DOMAIN_UNDEFINE_KEEP_NVRAM, VIR_DOMAIN_UNDEFINE_NVRAM, libvirtError)
|
from libvirt import (VIR_DOMAIN_UNDEFINE_KEEP_NVRAM, VIR_DOMAIN_UNDEFINE_NVRAM, libvirtError)
|
||||||
from logs.views import addlogmsg
|
from logs.views import addlogmsg
|
||||||
from vrtManager import util
|
from vrtManager import util
|
||||||
|
@ -973,7 +973,7 @@ def set_qos(request, pk):
|
||||||
messages.success(
|
messages.success(
|
||||||
request,
|
request,
|
||||||
_("%(qos_dir)s QoS is set. Network XML is changed. \
|
_("%(qos_dir)s QoS is set. Network XML is changed. \
|
||||||
Stop and start network to activate new config.") % {'qos_dir': qos_dir.capitalize()})
|
Stop and start network to activate new config." ) % {'qos_dir': qos_dir.capitalize()})
|
||||||
|
|
||||||
return redirect(request.META.get('HTTP_REFERER') + '#network')
|
return redirect(request.META.get('HTTP_REFERER') + '#network')
|
||||||
|
|
||||||
|
@ -991,7 +991,7 @@ def unset_qos(request, pk):
|
||||||
messages.success(
|
messages.success(
|
||||||
request,
|
request,
|
||||||
_("%(qos_dir)s QoS is deleted. Network XML is changed. \
|
_("%(qos_dir)s QoS is deleted. Network XML is changed. \
|
||||||
Stop and start network to activate new config.") % {'qos_dir': qos_dir.capitalize()})
|
Stop and start network to activate new config." ) % {'qos_dir': qos_dir.capitalize()})
|
||||||
return redirect(request.META.get('HTTP_REFERER') + '#network')
|
return redirect(request.META.get('HTTP_REFERER') + '#network')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import re
|
import re
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class AddInterface(forms.Form):
|
class AddInterface(forms.Form):
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from django.db.models import Model, CharField, DateTimeField
|
from django.db.models import Model, CharField, DateTimeField
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class Logs(Model):
|
class Logs(Model):
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import re
|
import re
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class AddNetPool(forms.Form):
|
class AddNetPool(forms.Form):
|
||||||
|
|
|
@ -2,7 +2,7 @@ from django.contrib import messages
|
||||||
from django.http import HttpResponseRedirect
|
from django.http import HttpResponseRedirect
|
||||||
from django.shortcuts import get_object_or_404, render
|
from django.shortcuts import get_object_or_404, render
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from libvirt import libvirtError
|
from libvirt import libvirtError
|
||||||
|
|
||||||
from admin.decorators import superuser_only
|
from admin.decorators import superuser_only
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from django.http import HttpResponseRedirect
|
from django.http import HttpResponseRedirect
|
||||||
from django.shortcuts import get_object_or_404, render
|
from django.shortcuts import get_object_or_404, render
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from libvirt import libvirtError
|
from libvirt import libvirtError
|
||||||
|
|
||||||
from admin.decorators import superuser_only
|
from admin.decorators import superuser_only
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import re
|
import re
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class AddStgPool(forms.Form):
|
class AddStgPool(forms.Form):
|
||||||
|
|
|
@ -4,7 +4,7 @@ from django.contrib import messages
|
||||||
from django.http import HttpResponse, HttpResponseRedirect
|
from django.http import HttpResponse, HttpResponseRedirect
|
||||||
from django.shortcuts import get_object_or_404, redirect, render
|
from django.shortcuts import get_object_or_404, redirect, render
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from libvirt import libvirtError
|
from libvirt import libvirtError
|
||||||
|
|
||||||
from admin.decorators import superuser_only
|
from admin.decorators import superuser_only
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from libvirt import libvirtError
|
from libvirt import libvirtError
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue