Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relax membership to allow unresolved people #75

Merged
merged 2 commits into from
Feb 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.9.1

Improvements requiring migrations:

* Add `Membership.person_name` property, allowing unresolved people to be members of Organizations

## 0.9.0 (2017-02-19)

Backwards-incompatible changes:
Expand Down
25 changes: 25 additions & 0 deletions opencivicdata/migrations/0006_auto_20170220_2057.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-02-20 20:57
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('opencivicdata', '0005_add_agenda_item_classification'),
]

operations = [
migrations.AddField(
model_name='membership',
name='person_name',
field=models.CharField(blank=True, default='', max_length=300),
),
migrations.AlterField(
model_name='membership',
name='person',
field=models.ForeignKey(null=True, on_delete=models.deletion.CASCADE, related_name='memberships', to='opencivicdata.Person'),
),
]
3 changes: 2 additions & 1 deletion opencivicdata/models/people_orgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ class PersonSource(LinkBase):
class Membership(OCDBase):
id = OCDIDField(ocd_type='membership')
organization = models.ForeignKey(Organization, related_name='memberships')
person = models.ForeignKey(Person, related_name='memberships')
person = models.ForeignKey(Person, related_name='memberships', null=True)
person_name = models.CharField(max_length=300, blank=True, default='')
post = models.ForeignKey(Post, related_name='memberships', null=True)
on_behalf_of = models.ForeignKey(Organization, related_name='memberships_on_behalf_of',
null=True)
Expand Down