def forwards(self, orm):

        try:
            # Get all valid avatars images from userprofile and set them as the
            # mugshot image for the userena profile app.
            for a in orm['userprofile.Avatar'].objects.filter(valid=True):
                try:
                    a.user.profile.mugshot = a.image
                    a.user.profile.save()
                except Exception, e:
                    print "Could not migrate avatar for '%s': %s" % (a.user,
                        e.message)
        except DatabaseError:
            pass
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/txcommon/migrations/0006_associate_avatars.py/Migration.forwards/original