Unverified Commit 3910ae3f authored by Joost Rijneveld's avatar Joost Rijneveld
Browse files

Actually migrate memberships

parent 584f1ca0
......@@ -13,7 +13,7 @@ from django.utils.translation import activate
from activemembers.models import (Board, Committee,
CommitteeMembership, Mentorship)
from members.models import Member
from members.models import Member, Membership
def imagefield_from_url(imagefield, url):
......@@ -153,6 +153,20 @@ class Command(BaseCommand):
user.member.bank_account = member['payment_iban']
user.member.save()
membership = Membership()
membership.user = user
if member['membership_type'] == 'Benefactor':
membership.type = 'supporter'
membership.until = parse_date("2017-09-01")
if member['membership_type'] == 'Yearly Membership':
membership.type = 'member'
membership.until = parse_date("2017-09-01")
if member['membership_type'] == 'Study Membership':
membership.type = 'member'
if member['membership_type'] == 'Honorary Member':
membership.type = 'honorary'
membership.save()
for membership in member['memberships']:
mdata = membership['membership']
if not mdata['begindate'] or mdata['begindate'][:4] == '0000':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment