diff options
| -rw-r--r-- | frontend/static/js/profile.js | 18 | ||||
| -rw-r--r-- | frontend/views.py | 2 |
2 files changed, 7 insertions, 13 deletions
diff --git a/frontend/static/js/profile.js b/frontend/static/js/profile.js index cf20985..addce07 100644 --- a/frontend/static/js/profile.js +++ b/frontend/static/js/profile.js @@ -246,20 +246,14 @@ var Settings = { Settings.bio = userProfile[6] } + Settings.data = Settings.defaults if (userProfile[7]) // settings - { - var lines = userProfile[7].split("\n") - for (i in lines) - { - var pair = lines[i].split("\t") - Settings.data[pair[0]] = pair[1] - } - } - for (i in Settings.defaults) - { - if (! (i in Settings.data)) - Settings.data[i] = Settings.defaults[i] + { + var s = userProfile[7] + for(i in s){ + Settings.data[i] = s[i] } + } Settings.load() } } diff --git a/frontend/views.py b/frontend/views.py index a391c0a..73b8d30 100644 --- a/frontend/views.py +++ b/frontend/views.py @@ -150,7 +150,7 @@ def profile(request, username): topz = SJContent.objects.filter(user__id=userprofile.user.id, content_type='video').annotate(likes=Count('sjlike')).order_by('-likes')[:50] likez = SJContent.objects.filter(user__id=userprofile.user.id, content_type='video', sjlike__isnull = False ).order_by('-datetime')[:50] vidz = SJContent.objects.filter(user__id=userprofile.user.id, content_type='video').order_by('-datetime')[:50] - profile = [ userprofile.id, userprofile.nickname, userprofile.score, 3, 4, 5, userprofile.bio, 7 ] + profile = [ userprofile.id, userprofile.nickname, userprofile.score, 3, 4, 5, userprofile.bio, json.loads(userprofile.settings_text) ] response = render_to_response( 'profile.html', |
