summaryrefslogtreecommitdiff
path: root/archaeological_finds/wizards.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/wizards.py')
-rw-r--r--archaeological_finds/wizards.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/archaeological_finds/wizards.py b/archaeological_finds/wizards.py
index d58ac411b..d49529bf8 100644
--- a/archaeological_finds/wizards.py
+++ b/archaeological_finds/wizards.py
@@ -48,8 +48,7 @@ class FindWizard(Wizard):
main_form_key = 'selecrecord-' + self.url_name
try:
idx = int(self.session_get_value(main_form_key, 'pk'))
- current_cr = ContextRecord.objects.get(pk=idx)
- return current_cr
+ return ContextRecord.objects.get(pk=idx)
except(TypeError, ValueError, ObjectDoesNotExist):
pass
current_item = self.get_current_object()
@@ -84,8 +83,8 @@ class FindWizard(Wizard):
if not current_cr or self.steps.current.startswith('select-'):
return context
context['reminders'] = (
- (_(u"Operation"), str(current_cr.operation)),
- (_(u"Context record"), str(current_cr)))
+ (_("Operation"), str(current_cr.operation)),
+ (_("Context record"), str(current_cr)))
return context
def get_extra_model(self, dct, m2m, form_list):
@@ -140,7 +139,7 @@ class TreatmentBase(Wizard):
try:
return [
models.Find.objects.get(pk=int(find_id.strip()))
- for find_id in find_ids.split(u',')
+ for find_id in find_ids.split(',')
]
except(TypeError, ValueError, AttributeError, ObjectDoesNotExist):
pass
@@ -197,7 +196,7 @@ class TreatmentWizard(TreatmentBase):
if isinstance(pks, models.Find):
pks = [pks]
if not isinstance(pks, (list, tuple)):
- pks = str(pks).split(u',')
+ pks = str(pks).split(',')
for pk in pks:
if isinstance(pk, models.Find):
@@ -374,8 +373,8 @@ class Treatment1NWizard(TreatmentBase):
if not finds:
return initial
lbl = finds[0].label
- initial['resultings_basket_name'] = str(_(u"Basket")) + u" - " + lbl
- initial['resultings_label'] = lbl + u"-"
+ initial['resultings_basket_name'] = str(_("Basket")) + " - " + lbl
+ initial['resultings_label'] = lbl + "-"
return initial
def get_extra_model(self, dct, m2m, form_list):
@@ -411,12 +410,12 @@ class Treatment1NWizard(TreatmentBase):
] = dct.pop(k)
messages.add_message(
self.request, messages.INFO,
- str(_(u"The new basket: \"{}\" have been created with the "
- u"resulting items. This search have been pinned.")
- ).format(dct["resulting_finds"]["basket_name"])
+ str(_("The new basket: \"{}\" have been created with the "
+ "resulting items. This search have been pinned.")
+ ).format(dct["resulting_finds"]["basket_name"])
)
- self.request.session["pin-search-find"] = u'{}="{}"'.format(
- str(pgettext("key for text search", u"basket")),
+ self.request.session["pin-search-find"] = '{}="{}"'.format(
+ str(pgettext("key for text search", "basket")),
dct["resulting_finds"]["basket_name"])
self.request.session['find'] = ''
return dct
@@ -487,7 +486,7 @@ class TreatmentFileAdministrativeActWizard(
pk = self.session_get_value(form_key, "pk")
try:
return (
- (_(u"Treatment request"),
+ (_("Treatment request"),
str(models.TreatmentFile.objects.get(pk=pk))),
)
except models.TreatmentFile.DoesNotExist:
@@ -499,7 +498,7 @@ class TreatmentFileAdministrativeActWizard(
if not admin.operation:
return
return (
- (_(u"Operation"), str(admin.operation)),
+ (_("Operation"), str(admin.operation)),
)
except AdministrativeAct.DoesNotExist:
return