Skip to content

Commit

Permalink
Merge pull request #153 from City-of-Helsinki/add-auth-code
Browse files Browse the repository at this point in the history
Add optional authorization code to comments
  • Loading branch information
akx committed Mar 15, 2016
2 parents 93dd0e1 + 8a0d57d commit 0e4787c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
25 changes: 25 additions & 0 deletions democracy/migrations/0010_auto_20160315_1026.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-15 10:26
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('democracy', '0009_section_type_model'),
]

operations = [
migrations.AddField(
model_name='hearingcomment',
name='authorization_code',
field=models.CharField(blank=True, max_length=32, verbose_name='authorization code'),
),
migrations.AddField(
model_name='sectioncomment',
name='authorization_code',
field=models.CharField(blank=True, max_length=32, verbose_name='authorization code'),
),
]
1 change: 1 addition & 0 deletions democracy/models/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class BaseComment(BaseModel):
parent_model = None # Required for factories and API
title = models.CharField(verbose_name=_('title'), blank=True, max_length=255)
content = models.TextField(verbose_name=_('content'))
authorization_code = models.CharField(verbose_name=_('authorization code'), max_length=32, blank=True)
author_name = models.CharField(verbose_name=_('author name'), max_length=255, blank=True, null=True, editable=False)
plugin_identifier = models.CharField(verbose_name=_('plugin identifier'), blank=True, max_length=255)
plugin_data = models.TextField(verbose_name=_('plugin data'), blank=True)
Expand Down
2 changes: 1 addition & 1 deletion democracy/views/hearing_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class HearingCommentCreateSerializer(BaseCommentSerializer):

class Meta:
model = HearingComment
fields = ['content', 'hearing']
fields = ['content', 'hearing', 'authorization_code']


class HearingCommentViewSet(BaseCommentViewSet):
Expand Down

0 comments on commit 0e4787c

Please sign in to comment.