dont split if . is escaped in key

This commit is contained in:
j 2011-09-26 20:38:29 +02:00
parent 3a5f49af05
commit 56c156d3f6

View file

@ -2,6 +2,7 @@
# vi:si:et:sw=4:sts=4:ts=4 # vi:si:et:sw=4:sts=4:ts=4
import random import random
random.seed() random.seed()
import re
from django import forms from django import forms
from django.contrib.auth.models import User from django.contrib.auth.models import User
@ -514,7 +515,7 @@ def setPreferences(request):
return return
''' '''
data = json.loads(request.POST['data']) data = json.loads(request.POST['data'])
keys = data.keys()[0].split('.') keys = re.sub('([^\\\\])\.', '\\1\n', data.keys()[0]).split('\n')
value = data.values()[0] value = data.values()[0]
profile = request.user.get_profile() profile = request.user.get_profile()
p = profile.preferences p = profile.preferences