Commit Graph

4 Commits (e573bb0990ece4b1a521ccf8a4c7bec5972d3538)

Author SHA1 Message Date
Eugen Rochko 2a90da1837
Fix UniqueUsernameValidator comparison ()
Comparison was downcasing only one side, therefore if previously
existing account had a non-lowercase spelling, it would be ignored
when checking for duplicates.

New rake task `mastodon:maintenance:find_duplicate_usernames` will
help find constraint violations that might have occured from the
presence of this bug.

Bump version to 2.3.3
ysksn 9e3d24a150 Fix AccountFinderConcern::AccountFinder#with_usernames ()
Matt Jankowski d1e08bd38c Handle nil and blank cases in Account finders ()
Matt Jankowski 2cc3111a77 Expand spec coverage and refactor the `Account.find_` methods ()
* Move specs for account finder methods to concern spec

* Move account finder methods to concern

* Improve spec wording

* Use more explicit comparison to ensure correct return value

* Add coverage for .find_local! and .find_remote!

* Add some methods to the finder

* Use arel on matching_username method

* Avoid ternary in matching domain method

* Simplify finder methods

* Use an AccountFinder class to simplify lookup