Commit c6eb6321 authored by Luuk Scholten's avatar Luuk Scholten
Browse files

Merge branch '167-migratieproblemen-members' into 'master'

Member migration: Fix typo in programme and format student numbers

See merge request !201
parents 274b0ba5 bbb3b274
......@@ -82,9 +82,11 @@ class Command(BaseCommand):
img = div.find('img')
imagefield_from_url(, "" + img['src'])
for member in data['members']:
for memberno, member in enumerate(data['members']):
user, cr = User.objects.get_or_create(username=member['username'])
print("Migrating {}".format(member['username']))
print("Migrating {} ({}/{})".format(member['username'],
user.username = member['username'] = member['email']
# Concrete5 uses bcrypt passwords, which django can rehash
......@@ -98,13 +100,13 @@ class Command(BaseCommand):
except Member.DoesNotExist:
user.member = Member()
user.member.programme = {
'Computer Science': 'computingsience',
'Computer Science': 'computingscience',
'Information Science': 'informationscience',
'Other': None,
'': None,
if member['student_number']:
user.member.student_number = member['student_number']
user.member.student_number = 's'+member['student_number']
if member['member_since']:
# This is as best as we can do, although this may be incorrect
user.member.starting_year = member['member_since']
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