diff --git a/symposion/schedule/views.py b/symposion/schedule/views.py index 996560f9..4afaa473 100644 --- a/symposion/schedule/views.py +++ b/symposion/schedule/views.py @@ -242,7 +242,7 @@ def schedule_json(request): "authors": [s.name for s in slot.content.speakers()], "contact": [ s.email for s in slot.content.speakers() - ] if request.user.is_staff else ["redacted"], + ] if request.user.has_perm('symposion_speakers.can_view_contact_details') or request.user.is_staff else ["redacted"], "abstract": slot.content.abstract, "conf_url": "%s://%s%s" % ( protocol, @@ -258,7 +258,7 @@ def schedule_json(request): data.append(slot_data) return HttpResponse( - json.dumps({"schedule": data}), + json.dumps({"schedule": data}, indent=2), content_type="application/json" ) diff --git a/symposion/speakers/migrations/0002_auto_20161230_1900.py b/symposion/speakers/migrations/0002_auto_20161230_1900.py new file mode 100644 index 00000000..68444662 --- /dev/null +++ b/symposion/speakers/migrations/0002_auto_20161230_1900.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-12-30 08:09 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('symposion_speakers', '0001_initial'), + ] + + operations = [ + migrations.AlterModelOptions( + name='speaker', + options={'ordering': ['name'], 'permissions': (('can_view_contact_details', 'Can View Contact Details'),), 'verbose_name': 'Speaker', 'verbose_name_plural': 'Speakers'}, + ), + ] diff --git a/symposion/speakers/models.py b/symposion/speakers/models.py index d1ba409e..ddbbceee 100644 --- a/symposion/speakers/models.py +++ b/symposion/speakers/models.py @@ -105,6 +105,7 @@ class Speaker(models.Model): ordering = ['name'] verbose_name = _("Speaker") verbose_name_plural = _("Speakers") + permissions = (('can_view_contact_details', 'Can View Contact Details'),) def save(self, *args, **kwargs): self.biography_html = parse(self.biography)