def forwards(self, orm):
        """Validate Twitter accounts so they don't contain the leading @."""
        for user in orm["users.externalaccount"].objects.filter(type=ExternalAccount.TYPE_TWITTER):
            try:
                twitter_identifier = validate_twitter(user.identifier)
            except ValidationError as exception:
                print "Error migrating twitter username for user %s: %s" % (user, exception)
                continue

            user.identifier = twitter_identifier
            user.save()
Exemplo n.º 2
0
    def forwards(self, orm):
        """Validate Twitter accounts so they don't contain the leading @."""
        for user in orm['users.externalaccount'].objects.filter(
                type=ExternalAccount.TYPE_TWITTER):
            try:
                twitter_identifier = validate_twitter(user.identifier)
            except ValidationError as exception:
                print 'Error migrating twitter username for user %s: %s' % (
                    user, exception)
                continue

            user.identifier = twitter_identifier
            user.save()
Exemplo n.º 3
0
 def test_twitter_username_parsing(self):
     username = '******'
     eq_('validusername', validate_twitter(username))
     username = '******'
     eq_('ValidName', validate_twitter(username))
Exemplo n.º 4
0
 def test_twitter_username_parsing(self):
     username = '******'
     eq_('validusername', validate_twitter(username))
     username = '******'
     eq_('ValidName', validate_twitter(username))
Exemplo n.º 5
0
 def test_twitter_username_parsing(self):
     username = "******"
     eq_("validusername", validate_twitter(username))
     username = "******"
     eq_("ValidName", validate_twitter(username))