Skip to content

Commit

Permalink
[#203] Add print statements to migration 0038
Browse files Browse the repository at this point in the history
To try debug the migration that fails when deployed to UAT
  • Loading branch information
zzgvh committed Jun 13, 2013
1 parent df70bf0 commit c655930
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion akvo/rsr/migrations/0038_limit_org_partner_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@ def forwards(self, orm):
partner_types_for_org.add(partner_type)
partner_types = orm['rsr.PartnerType'].objects.all()
partner_types_dict = {partner_type.id: partner_type for partner_type in partner_types}
print "Partner types lookup: {partner_types_dict}".format(partner_types_dict=partner_types_dict)
for organisation, allowed_partner_types in organisations.items():
allowed_list = []
for id in list(allowed_partner_types):
print "ID:", id
print "Lookup: {partner_types_dict}".format(partner_types_dict=partner_types_dict[id].id)
allowed_list += [partner_types_dict[id]]
print "Allowed list: {allowed_list}".format(allowed_list=allowed_list)
organisation.partner_types.add(
*[partner_types_dict[id] for id in list(allowed_partner_types)]
*allowed_list
)
print u"Organisation {org_name} partner types: {allowed_partner_types}".format(
org_name=organisation.name, allowed_partner_types=', '.join(list(allowed_partner_types))
Expand Down

0 comments on commit c655930

Please sign in to comment.