Skip to content

Don't delete periods when validating username uniqueness (#11392)#11400

Merged
Gargron merged 5 commits intomastodon:masterfrom
vulpineclub:fix-tootsuite-11392
Jul 24, 2019
Merged

Don't delete periods when validating username uniqueness (#11392)#11400
Gargron merged 5 commits intomastodon:masterfrom
vulpineclub:fix-tootsuite-11392

Conversation

@rtucker
Copy link
Copy Markdown
Contributor

@rtucker rtucker commented Jul 23, 2019

The 20190715164535_add_instance_actor migration fails if there's already a username similar to the domain name, e.g. if you are 'vulpine.club' and have a user named 'vulpineclub', validation fails.

Upon further review, usernames with periods are dropped by the regular expression in the Account class, so we don't need to worry about it here.

Fixes #11392

Rey Tucker added 5 commits July 23, 2019 10:35
This makes sure that migration 20190715164535_add_instance_actor
won't fail if there's already an account that is named the same
as the domain (minus the .)
)

The 20190715164535_add_instance_actor migration fails if there's
already a username similar to the domain name, e.g. if you are
'vulpine.club' and have a user named 'vulpineclub', validation
fails.

Upon further review, usernames with periods are dropped by the
regular expression in the Account class, so we don't need to
worry about it here.

Fixes mastodon#11392
@Gargron
Copy link
Copy Markdown
Member

Gargron commented Jul 24, 2019

Why haven't the checks run?

@ClearlyClaire
Copy link
Copy Markdown
Contributor

@Gargron no idea. Isn't there a way for you to force it to run again?

@Gargron
Copy link
Copy Markdown
Member

Gargron commented Jul 24, 2019

@ThibG No, the checks tab is just empty

@ClearlyClaire
Copy link
Copy Markdown
Contributor

Anyway, the tests pass, so it should be fine to merge

@rtucker
Copy link
Copy Markdown
Contributor Author

rtucker commented Jul 24, 2019

I didn't break it, it was on fire when I got here :)

@Gargron Gargron merged commit 94f5c71 into mastodon:master Jul 24, 2019
hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
…1392) (mastodon#11400)

* Check to make sure usernames with '.' cannot be created

* Add test for instance actor account name conflicts

This makes sure that migration 20190715164535_add_instance_actor
won't fail if there's already an account that is named the same
as the domain (minus the .)

* Put the test into the correct context...

* Add another test to split this into two validations

* Don't delete periods when validating username uniqueness (mastodon#11392)

The 20190715164535_add_instance_actor migration fails if there's
already a username similar to the domain name, e.g. if you are
'vulpine.club' and have a user named 'vulpineclub', validation
fails.

Upon further review, usernames with periods are dropped by the
regular expression in the Account class, so we don't need to
worry about it here.

Fixes mastodon#11392
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migration for PR #11321 fails to add instance.tld if there is already an account named instancetld

3 participants