Merge pull request #65 from faulteh/speaker_deets_permission
Add a permission to view speaker contact details in conference.json
This commit is contained in:
		
						commit
						ae9f1e0b67
					
				
					 3 changed files with 22 additions and 2 deletions
				
			
		|  | @ -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" | ||||
|     ) | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										19
									
								
								symposion/speakers/migrations/0002_auto_20161230_1900.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								symposion/speakers/migrations/0002_auto_20161230_1900.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -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'}, | ||||
|         ), | ||||
|     ] | ||||
|  | @ -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) | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Scott Bragg
						Scott Bragg