diff --git a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/create.py b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/create.py
index 614ee6be..08a18865 100644
--- a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/create.py
+++ b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/create.py
@@ -389,7 +389,7 @@ class CheckboxSelectMultiple(forms.CheckboxSelectMultiple):
final_attrs = self.build_attrs(attrs, name=name)
output = []
initial_service = uuidutils.generate_uuid()
- str_values = set([encoding.force_text(v) for v in value])
+ str_values = set([encoding.force_str(v) for v in value])
for i, (option_value, option_label) in enumerate(
itertools.chain(self.choices, choices)):
current_service = option_value.split(':')[0]
@@ -398,10 +398,10 @@ class CheckboxSelectMultiple(forms.CheckboxSelectMultiple):
output.append("")
service_description = _("%s processes: ") % current_service
service_description = html.conditional_escape(
- encoding.force_text(service_description))
+ encoding.force_str(service_description))
output.append("" % service_description)
initial_service = current_service
- output.append(encoding.force_text("
"))
+ output.append(encoding.force_str(""))
if has_id:
final_attrs = dict(final_attrs, id='%s_%s' % (attrs['id'], i))
label_for = ' for="%s"' % final_attrs['id']
@@ -410,10 +410,10 @@ class CheckboxSelectMultiple(forms.CheckboxSelectMultiple):
cb = forms.CheckboxInput(
final_attrs, check_test=lambda value: value in str_values)
- option_value = encoding.force_text(option_value)
+ option_value = encoding.force_str(option_value)
rendered_cb = cb.render(name, option_value)
option_label = html.conditional_escape(
- encoding.force_text(option_label))
+ encoding.force_str(option_label))
output.append(
'' %
(label_for, rendered_cb, option_label))
diff --git a/sahara_dashboard/content/data_processing/clusters/wizard/forms.py b/sahara_dashboard/content/data_processing/clusters/wizard/forms.py
index fc313738..7fa43083 100644
--- a/sahara_dashboard/content/data_processing/clusters/wizard/forms.py
+++ b/sahara_dashboard/content/data_processing/clusters/wizard/forms.py
@@ -13,7 +13,7 @@
from django import template
from django.template import defaultfilters
-from django.utils.encoding import force_text
+from django.utils.encoding import force_str
from django.utils.translation import gettext_lazy as _
from horizon import exceptions
@@ -83,7 +83,7 @@ class ChoosePluginForm(forms.SelfHandlingForm):
tmpl = template.loader.get_template(self.help_text_template)
text += tmpl.render(extra_context, self.request)
else:
- text += defaultfilters.linebreaks(force_text(self.help_text))
+ text += defaultfilters.linebreaks(force_str(self.help_text))
return defaultfilters.safe(text)
class Meta(object):
diff --git a/sahara_dashboard/content/data_processing/jobs/job_binaries/forms.py b/sahara_dashboard/content/data_processing/jobs/job_binaries/forms.py
index 62eb9a30..14437d39 100644
--- a/sahara_dashboard/content/data_processing/jobs/job_binaries/forms.py
+++ b/sahara_dashboard/content/data_processing/jobs/job_binaries/forms.py
@@ -17,7 +17,7 @@ import uuid
from django.forms import widgets
from django import template
from django.template import defaultfilters
-from django.utils.encoding import force_text
+from django.utils.encoding import force_str
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
@@ -333,7 +333,7 @@ class JobBinaryCreateForm(forms.SelfHandlingForm):
tmpl = template.loader.get_template(self.help_text_template)
text += tmpl.render(extra_context, self.request)
else:
- text += defaultfilters.linebreaks(force_text(self.help_text))
+ text += defaultfilters.linebreaks(force_str(self.help_text))
return defaultfilters.safe(text)
class Meta(object):
diff --git a/sahara_dashboard/content/data_processing/jobs/jobs/tables.py b/sahara_dashboard/content/data_processing/jobs/jobs/tables.py
index 40919415..1a49e6a4 100644
--- a/sahara_dashboard/content/data_processing/jobs/jobs/tables.py
+++ b/sahara_dashboard/content/data_processing/jobs/jobs/tables.py
@@ -11,6 +11,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from urllib import parse
+
from django.http import Http404 # noqa
from django.urls import reverse
from django.utils import http
@@ -176,7 +178,7 @@ class JobsTable(sahara_table.SaharaPaginateTabbedTable):
job_template_id = job_execution.job_id
return reverse("horizon:project:data_processing."
"jobs:jt-details",
- args=(http.urlquote(job_template_id),))
+ args=(parse.quote(job_template_id),))
else:
# No link should be generated for a deleted Job.
return None
@@ -191,7 +193,7 @@ class JobsTable(sahara_table.SaharaPaginateTabbedTable):
if job_execution.cluster_name:
return reverse(
"horizon:project:data_processing.clusters:cluster-details",
- args=(http.urlquote(job_execution.cluster_id),))
+ args=(parse.quote(job_execution.cluster_id),))
else:
# No link should be generated for a deleted Cluster.
return None
diff --git a/sahara_dashboard/content/data_processing/jobs/wizard/forms.py b/sahara_dashboard/content/data_processing/jobs/wizard/forms.py
index 27223895..49bfcb41 100644
--- a/sahara_dashboard/content/data_processing/jobs/wizard/forms.py
+++ b/sahara_dashboard/content/data_processing/jobs/wizard/forms.py
@@ -13,7 +13,7 @@
from django import template
from django.template import defaultfilters
-from django.utils.encoding import force_text
+from django.utils.encoding import force_str
from django.utils.translation import gettext_lazy as _
from horizon import exceptions
@@ -78,7 +78,7 @@ class ChoosePluginForm(forms.SelfHandlingForm):
tmpl = template.loader.get_template(self.help_text_template)
text += tmpl.render(extra_context, self.request)
else:
- text += defaultfilters.linebreaks(force_text(self.help_text))
+ text += defaultfilters.linebreaks(force_str(self.help_text))
return defaultfilters.safe(text)
class Meta(object):
@@ -107,8 +107,8 @@ class ChooseJobTypeForm(forms.SelfHandlingForm):
try:
hlps = helpers.Helpers(request)
job_type = context["guide_job_type"]
- if force_text(request.session.get("guide_job_type")) != (
- force_text(helpers.JOB_TYPE_MAP[job_type][0])):
+ if force_str(request.session.get("guide_job_type")) != (
+ force_str(helpers.JOB_TYPE_MAP[job_type][0])):
hlps.reset_job_guide()
request.session["guide_job_type"] = (
helpers.JOB_TYPE_MAP[job_type][0])