From 91e246b96513d0a8b22cb685e1511665d7ad26a2 Mon Sep 17 00:00:00 2001 From: Sanj Date: Mon, 12 Mar 2012 12:02:58 +0530 Subject: [PATCH] strip string --- manifests/ships/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/ships/views.py b/manifests/ships/views.py index ec4b9f0..a5180a1 100644 --- a/manifests/ships/views.py +++ b/manifests/ships/views.py @@ -10,6 +10,7 @@ from ox.django.shortcuts import render_to_json_response from django.views.decorators.csrf import csrf_exempt from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator, InvalidPage, EmptyPage +import pdb @login_required def googletranslate(request, model, field): @@ -138,7 +139,7 @@ def stringtranslate(request): model = request.POST.get("model", "") field = request.POST.get("field", "") id = request.POST.get("id", 0) - string = request.POST.get("string", "") + string = request.POST.get("string", "").strip() translation = request.POST.get("translation", "") if model == 'Translation': obj = Translation.objects.get(pk=id) @@ -154,6 +155,7 @@ def stringtranslate(request): trans_field = field + "_trans" matches = m.objects.filter(q) savedObjects = 0 + pdb.set_trace() for match in matches: match.__setattr__(trans_field, translation) match.save()