Is there a reason you have chosen to do this rather than the following (not tested):

('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm[getattr(settings, 'AUTH_USER_MODEL', 'auth.User')], null=True)),

Using the name rather than an object reference seems more consistent with how south likes these files to look.