Repository: learningequality/kolibri

Issue:
Browser keep refreshing at the profile page.
### Observed behavior

A user with a special character full name at the profile page will cause the browser to keep refreshing.

### Expected behavior

Fix the issue why it's keep refreshing.

### User-facing consequences

![temp](https://user-images.githubusercontent.com/8663934/33421818-4f590360-d5ee-11e7-92c0-714c023613ff.gif)

```
browser console logs
```

### Steps to reproduce

Create a Kolibri user account with a special character full name. And navigate at the profile page.

### Context

Kolibri version: v0.7.0-beta3
Operating system: Windows 7 32 bit
Browser: Google chrome Version 62.0.3202.94 (Official Build) (32-bit)


Discussion:
Cool @mrpau-richard! I just reproduced this. But it seems to be due to the name you used `';';';'`. Just adding a `;` for example doesn't caused this.
Just noticed that having this name also causes the 'facility management' page to refresh too.
@mrpau-richard If you're having trouble using the app, you can fix your user by going to this API UI http://localhost:8000/api/facilityuser and plugging the ID at the end of that url: e.g. `http://localhost:8000/api/facilityuser/6bcd358057d95c64c41fe89066bb6287/`

Resolving patch:
diff --git a/kolibri/core/templatetags/kolibri_tags.py b/kolibri/core/templatetags/kolibri_tags.py
--- a/kolibri/core/templatetags/kolibri_tags.py
+++ b/kolibri/core/templatetags/kolibri_tags.py
@@ -98,11 +98,11 @@ def kolibri_set_server_time():
 def kolibri_bootstrap_model(context, base_name, api_resource, **kwargs):
     response, kwargs, url_params = _kolibri_bootstrap_helper(context, base_name, api_resource, 'detail', **kwargs)
     html = ("<script type='text/javascript'>"
-            "var model = {0}.resources.{1}.createModel(JSON.parse('{2}'), {3});"
+            "var model = {0}.resources.{1}.createModel(JSON.parse({2}), {3});"
             "model.synced = true;"
             "</script>".format(settings.KOLIBRI_CORE_JS_NAME,
                                api_resource,
-                               JSONRenderer().render(response.data).decode('utf-8'),
+                               json.dumps(JSONRenderer().render(response.data).decode('utf-8')),
                                json.dumps(url_params)))
     return mark_safe(html)
 
@@ -110,13 +110,13 @@ def kolibri_bootstrap_model(context, base_name, api_resource, **kwargs):
 def kolibri_bootstrap_collection(context, base_name, api_resource, **kwargs):
     response, kwargs, url_params = _kolibri_bootstrap_helper(context, base_name, api_resource, 'list', **kwargs)
     html = ("<script type='text/javascript'>"
-            "var collection = {0}.resources.{1}.createCollection({2}, {3}, JSON.parse('{4}'));"
+            "var collection = {0}.resources.{1}.createCollection({2}, {3}, JSON.parse({4}));"
             "collection.synced = true;"
             "</script>".format(settings.KOLIBRI_CORE_JS_NAME,
                                api_resource,
                                json.dumps(url_params),
                                json.dumps(kwargs),
-                               JSONRenderer().render(response.data).decode('utf-8'),
+                               json.dumps(JSONRenderer().render(response.data).decode('utf-8')),
                                ))
     return mark_safe(html)
 


Test patch: