tip_migration

Participants who received tips directly under Gittipay 1.0 will have their tips migrated if and when they become the owner of a new Gratipay 2.0 team.

exception gratipay.models.team.mixins.tip_migration.AlreadyMigrated[source]

Raised by migrate_tips().

class gratipay.models.team.mixins.tip_migration.TipMigrationMixin[source]

This mixin provides tip migration for teams.

migrate_tips()[source]

Migrate the Team owner’s Gratipay 1.0 tips into 2.0 payment instructions to the Team.

Returns:None
Raises:AlreadyMigrated if payment instructions already exist for this Team

This method gets called under migrate_all_tips() during payday.

gratipay.models.team.mixins.tip_migration.migrate_all_tips(db, print=<built-in function print>)[source]

Migrate tips for all teams.

Parameters:
  • db (GratipayDB) – a database object
  • print (func) – a function that takes lines of log output
Returns:

None

This function loads Team objects for all Teams where the owner had tips under Gratipay 1.0 but those tips have not yet been migrated into payment instructions under Gratipay 2.0. It then migrates the tips using migrate_tips().

This function is wrapped in a script, bin/migrate-tips.py, which is used during payday.