Compare commits

...

3 Commits

Author SHA1 Message Date
chr ef0480cbad add attribution info to scss 2018-04-02 19:30:05 -07:00
chr 6826b6466c Witches.town theme as of 2.3.3 2018-04-02 19:25:50 -07:00
Eugen Rochko 9924ca8810 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
2018-03-27 02:14:05 +02:00
10 changed files with 103 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -30,7 +30,7 @@ module AccountFinderConcern
end
def account
scoped_accounts.take
scoped_accounts.order(id: :asc).take
end
private

View File

@ -6,7 +6,7 @@ class UniqueUsernameValidator < ActiveModel::Validator
normalized_username = account.username.downcase.delete('.')
scope = Account.where(domain: nil, username: normalized_username)
scope = Account.where(domain: nil).where('lower(username) = ?', normalized_username)
scope = scope.where.not(id: account.id) if account.persisted?
account.errors.add(:username, :taken) if scope.exists?

View File

@ -1 +1,2 @@
default: styles/application.scss
witches: styles/witches-town.scss

View File

@ -13,7 +13,7 @@ module Mastodon
end
def patch
2
3
end
def pre

View File

@ -740,6 +740,24 @@ namespace :mastodon do
LinkCrawlWorker.push_bulk status_ids
end
desc 'Find case-insensitive username duplicates of local users'
task find_duplicate_usernames: :environment do
include RoutingHelper
disable_log_stdout!
duplicate_masters = Account.find_by_sql('SELECT * FROM accounts WHERE id IN (SELECT min(id) FROM accounts WHERE domain IS NULL GROUP BY lower(username) HAVING count(*) > 1)')
pastel = Pastel.new
duplicate_masters.each do |account|
puts pastel.yellow("First of their name: ") + pastel.bold(account.username) + " (#{admin_account_url(account.id)})"
Account.where('lower(username) = ?', account.username.downcase).where.not(id: account.id).each do |duplicate|
puts " " + pastel.red("Duplicate: ") + admin_account_url(duplicate.id)
end
end
end
desc 'Remove all home feed regeneration markers'
task remove_regeneration_markers: :environment do
keys = Redis.current.keys('account:*:regeneration')

Binary file not shown.

View File

@ -0,0 +1,17 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="witchesAwesome" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xf005;" glyph-name="pentagram" d="M510.58 942.996c-184.53 1.564-364.1-111.374-443.5-277.82-71.936-146.226-66.342-328.58 18.451-468.36 78.326-132.962 221-227.020 375.26-241.26 145.944-15.337 298.060 37.224 401.020 142.342 105.984 105.74 161.442 260.96 141.698 409.86-18.164 150.966-109.406 291.74-241.74 367.36-75.748 44.274-163.348 68.6-251.2 67.852zM511.955 877.938c77.94-0.729 157.286-19.971 222.44-63.578-7.158-8.725-19.113-11.948-27.078-20.040-46.696-32.916-91.812-69.998-140.008-99.496-4.173 6.813-14.93 10.826-20.378 3.172-16.031-11.647-32.062-23.296-48.094-34.942 23.094-16.779 46.19-33.556 69.282-50.34 44.97 31.004 88.074 66.636 133.816 95.274-17.166-51.494-33.696-103.874-50.704-155.656 18.421-13.383 36.84-26.77 55.258-40.156 29.234 86.76 55.21 175.018 86.082 260.98 9.726-4.959 15.409-15.588 24.35-21.924 102.536-102.164 148.168-258.24 114.116-399.22-3.055-5.326-9.686 3.308-13.18 4.891-27.878 22.42-58.158 41.804-86.642 63.53-180.662 131.518-362.56 261.94-541.92 394.86 7.143 7.717 18.841 9.481 27.284 15.763 60.014 30.712 128.128 47 195.388 46.896zM232.255 772.43c6.605-10.949 6.228-24.694 12.315-36.014 24.292-74.76 48.582-149.52 72.876-224.28 18.409 13.381 36.822 26.756 55.234 40.132-15.572 52.458-36.018 103.754-49.188 156.61 9.684-6.581 18.537-14.803 28.786-21.042 155.224-113.374 312.38-225.48 466.24-339.86-24.25-1.022-49.308 0.414-73.852-0.156h-304.36c7.037-21.67 14.079-43.338 21.118-65.008 148.86-0.743 297.74 1.358 446.58-1.051-1.687-10.938-9.977-19.945-13.5-30.464-65.992-129.252-201.8-222.5-347-231 1.308 13.86 9.436 26.764 12.66 40.508 23.322 73.804 47.778 147.244 71.536 220.96h-68.27c-18.181-51.576-32.076-105.642-52.266-155.696-34.84 108.174-70.422 216.72-105.506 325.040-3.697 11.377-7.392 22.756-11.091 34.132-18.432-13.398-36.864-26.796-55.3-40.188 45.286-141.782 93.378-282.82 136.964-425.020-10.729-1.784-21.644 3.362-32.456 3.31-143.878 22.44-273.36 122.998-327.74 258 5.131 5.323 14.995 0.113 21.772 1.506 62.562-1.498 125.252 2.248 187.736-1.444-0.818-8.085 5.479-18.17 14.637-15.129h56.062c-8.817 27.152-17.644 54.3-26.46 81.454-54.364 1.513-111.454-2.481-164.058 1.867 101.918 73.342 203.56 147.862 305.4 221.6-18.434 13.391-36.864 26.786-55.296 40.18-120.898-86.814-240.28-176.486-362.040-261.56-5.029 9.779-3.285 21.864-6.808 32.334-22.714 142.086 31.844 296.92 143.288 389.78 0.427-0.906 1.619 2.137 1.988 0.504zM627.74 480c-14.206-43.718-28.412-87.436-42.614-131.156h68.376c10.419 32.064 20.836 64.128 31.258 96.192-18.44 13.398-36.88 26.798-55.316 40.2-0.568-1.745-1.135-3.49-1.703-5.234z" />
<glyph unicode="&#xf015;" glyph-name="witch-cauldron" d="M929.929 528.641c0 44.407-82.631 83.227-205.761 104.296l90.395 296.58c3.171 10.381-2.675 21.37-13.056 24.527l-16.736 5.093c-10.374 3.175-21.34-2.678-24.511-13.056l-93.005-305.040c-47.998 5.563-100.376 8.635-155.233 8.635-230.826 0-417.948-54.207-417.948-121.039 0-24.179 24.484-46.738 66.752-65.636l-0.585-1.261c-78.199-105.224-37.609-263.071-37.609-263.071 12.372-51.995 41.812-90.671 79.59-119.419h-0.543v-61.15c-15.853 3.492-30.22-2.308-32.539-13.515-2.438-11.65 9.079-24.683 25.707-29.115 16.598-4.421 32.038 1.406 34.453 13.056l0.214 1.345 0.772 70.641c81.412-47.876 187.344-60.187 250.767-62.976l0.615-47.001c2.415-11.654 17.848-17.477 34.449-13.056 16.625 4.428 28.145 17.465 25.707 29.115-2.312 11.211-16.686 17.007-32.539 13.515v16.694c53.092 0.397 173.172 7.279 266.62 57.069l0.703-64 0.218-1.345c2.411-11.65 17.848-17.477 34.449-13.056 16.625 4.432 28.141 17.465 25.703 29.115-2.315 11.211-16.682 17.007-32.539 13.515v52.977c43.196 29.467 77.328 70.5 90.919 127.592 0 0 40.364 156.994-36.956 262.219h0.015c45.133 19.357 71.509 42.668 71.509 67.753zM512.027 439.197c-193.48 0-350.295 41.717-350.295 93.223 0 51.456 156.815 93.173 350.295 93.173 52.843 0 102.955-3.122 147.881-8.696l-4.287-14.038h-0.004c-31.179-3.049-55.552-29.356-55.552-61.345 0-2.545 0.203-5.059 0.493-7.52h122.277c0.306 2.461 0.508 4.975 0.508 7.52 0 15.303-5.598 29.306-14.829 40.081l8.062 26.46c88.256-16.908 145.703-44.487 145.703-75.635 0-51.502-156.815-93.223-350.253-93.223zM380.174 524.976c-24.068 0-43.589-19.533-43.589-43.604 0-1.792 0.145-3.565 0.359-5.307h86.464c0.225 1.742 0.371 3.515 0.371 5.307 0 24.072-19.517 43.604-43.604 43.604zM472.629 598.969c-17.431 0-31.568-14.13-31.568-31.568 0-1.307 0.107-2.587 0.267-3.844h62.617c0.157 1.257 0.252 2.537 0.252 3.844 0 17.439-14.126 31.568-31.568 31.568z" />
<glyph unicode="&#xf079;" glyph-name="ouroboros" horiz-adv-x="1009" d="M658.837 855.237c3.298-27.046-34.137-51.721-83.607-55.107-49.479-3.373-92.268 15.821-95.558 42.873-1.846 15.216 9.187 29.682 27.995 40.028 1.827 0.996 3.732 1.966 5.708 2.891 13.806 6.472 30.988 10.892 49.926 12.181 49.479 3.386 92.243-15.808 95.54-42.866zM908.111 873.649c-113.289-20.411-252.95 151.162-429.572 58.89l-0.006-0.007c-32.706-17.084-66.685-43.224-101.997-81.298-64.92-21.056-210.292-36.147-294.324-90.126-121.314-77.927 84.082-266.322 133.426-241.782 32.569 16.205 113.356 50.465 137.353 52.939l-13.982 19.598 14.422 19.265c22.087 29.474 37.247 64.302 46.674 104.158l8.092 45.862c0.104 0.762 0.214 1.511 0.298 2.272l64.877-7.702c-7.030-59.684-23.473-115.178-53.353-162.991 30.295-39.585 71.55-84.638 121.042-121.968 85.249-59.769 182.11-106.825 269.056-76.341-71.229 33.367-125.216 72.933-161.793 114.887-41.251 47.346-61.839 99.818-50.568 148.928 8.455 36.824 35.348 66.451 73.914 84.94 12.86 6.159 27.011 11.081 42.21 14.63 57.921 13.51 133.432 10.554 228.318-12.677 9.135 46.090-5.371 87.86-34.092 128.525zM779.836 686.702c-0.117 0.046-0.228 0.078-0.346 0.111-15.893 3.828-29.997 2.116-39.048 0.007-9.42-2.201-16.761-7.312-22.656-11.42-2.293-1.595-4.438-3.099-6.498-4.284-1.153-0.651-1.782-1.94-1.607-3.262 0.173-1.315 1.127-2.396 2.41-2.721l12.886-3.412-11.72-42.469-22.106 5.651c-1.037 0.248-2.164-0.072-2.961-0.814-0.79-0.755-1.14-1.856-0.953-2.936 2.449-13.653 9.705-28.745 20.979-43.648 0.333-0.436 0.764-0.781 1.263-1.003 143.921-64.623 136.099-193.932 127.049-343.675-1.16-19.141-2.352-38.941-3.187-58.368-0.026-0.142-2.592-14.59-13.036-27.821-8.442-10.697-22.087-15.925-40.888-15.346l-580.469 0.026c-2.3 0-4.555 2.272-4.555 4.584l-3.515 341.514c-49.745 8.79-136.852 84.341-166.287 153.002-22.935-32.573-24.562-59.059-24.562-101.911v-392.605c0-110.227 89.231-199.908 198.92-199.908h579.185c104.43 0 225.842 88.286 225.836 201.957l0.444 9.552c12.189 261.179 20.988 449.882-224.583 539.199z" />
<glyph unicode="&#xf0ac;" glyph-name="crystal-ball" d="M112.088 283.184l-60.647-303.221c-2.158-10.799 0.638-21.997 7.616-30.513 6.982-8.516 17.415-13.45 28.424-13.45h849.030c11.009 0 21.442 4.937 28.424 13.45 6.978 8.516 9.778 19.715 7.616 30.513l-60.647 303.221c-3.434 17.18-18.518 29.548-36.040 29.548h-727.733c-17.518 0.003-32.606-12.364-36.043-29.548zM838.184 364.187c38.647 60.233 61.102 131.799 61.102 208.524 0 213.551-173.739 387.289-387.286 387.289s-387.286-173.739-387.286-387.286c0-76.724 22.456-148.294 61.102-208.524h652.367zM512 817.619c14.208 0 25.728-11.519 25.728-25.728 0-14.212-11.519-25.731-25.728-25.731-106.668 0-193.446-86.781-193.446-193.446 0-14.208-11.519-25.728-25.731-25.728-14.208 0-25.728 11.519-25.728 25.728 0 135.040 109.865 244.905 244.905 244.905z" />
<glyph unicode="&#xf0f3;" glyph-name="raven(2)" d="M1022.389 863.166c-11.059 15.192-42.59 26.047-63.974 26.286-5.962 0.067-19.176 2.013-35.906 4.48-32.705 4.817-82.137 12.102-124.684 12.102-30.387 0-52.583-3.562-67.842-10.884-39.815-14.26-59.428-49.295-78.397-83.18-3.731-6.664-7.587-13.555-11.464-20.041-3.734-5.717-22.913-22.963-45.121-42.928-33.084-29.743-78.397-70.481-105.435-102.382-35.475-41.856-72.59-78.115-108.481-113.179-51.345-50.16-104.436-102.030-156.375-173.082-12.713-17.397-16.971-29.927-13.013-38.315 4.963-10.509 21.166-11.441 34.179-12.189 5.505-0.315 15.745-0.906 16.275-2.819 0.687-2.496-5.181-11.449-52.24-43.333l-0.259-0.198c-50.824-43.447-177.634-159.090-178.948-160.29-4.718-4.465-6.53-8.63-5.388-12.375 1.29-4.223 5.738-5.779 6.856-5.965 1.226-0.204 1.858-0.44 2.158-0.591-0.51-1.692-4.212-5.822-7.22-9.18-9.891-11.036-26.446-29.504-27.107-55.688-0.067-2.706 0.792-4.846 2.557-6.655 4.037-4.142 12.198-4.555 19.645-4.555 0.003 0 0.003 0 0.006 0 3.408 0 7.075-0.012 10.619 0.119 3.562 0.131 7.244 0.192 10.675 0.192 6.183 0 14.74-0.422 17.606-3.754 0.603-0.702 1.36-1.96 0.955-4.631-0.486-3.236 0.052-5.799 1.599-7.596 1.465-1.698 3.664-2.566 6.539-2.566 17.085 0 62.745 31.097 116.226 68.669 18.37 12.906 34.231 24.049 39.981 26.839 13.829 6.713 33.791 21.037 56.903 37.627 40.080 28.764 89.957 64.563 116.805 64.563 9.154 0 14.676-4.069 17.382-12.804 1.075-3.469 4.299-7.608 13.549-7.608 19.599 0 59.745 18.352 98.083 38.6 7.643-14.761 18.55-24.366 29.073-29.219-0.044-17.787-0.128-43.196-0.766-66.526-0.079-0.076-0.154-0.175-0.236-0.239-3.751-2.994-10.042-3.070-18.011-3.166-13.005-0.157-30.812-0.37-49.307-14.472-10.785-8.225-17.918-19.998-19.537-25.732-0.428-1.52-0.28-2.779 0.446-3.74 0.617-0.816 1.567-1.282 2.604-1.282 0.848 0 1.695 0.306 2.589 0.941l1.884 1.346c5.991 4.296 20.024 14.353 27.535 17.21 10.162 3.868 17.624 5.444 25.759 5.444 7.043 0 14.985-1.215 25.153-3.481-1.002-16.724-2.543-29.111-4.943-31.319-3.751-2.994-10.042-3.070-18.011-3.166-13.005-0.157-30.812-0.37-49.307-14.472-10.785-8.225-17.918-19.998-19.537-25.732-0.428-1.52-0.28-2.779 0.446-3.74 0.617-0.816 1.567-1.282 2.604-1.282 0.848 0 1.695 0.306 2.589 0.941l1.884 1.346c5.991 4.296 20.024 14.353 27.535 17.21 10.162 3.868 17.624 5.444 25.759 5.444 10.704 0 23.373-2.758 43.013-7.844 12.075-3.128 22.383-4.648 31.517-4.648 11.898 0 20.522 2.514 29.653 5.176 10.57 3.081 21.501 6.265 39.354 6.265 3.317 0 6.818-0.114 10.407-0.338 19.535-1.223 37.065-11.408 45.485-16.304 3.702-2.149 4.82-2.799 6.105-2.799l2.036 0.076 0.772 1.724c0.982 2.182-0.163 3.475-5.65 9.661-19.17 21.585-35.763 25.578-52.484 28.019-6.3 0.917-11.237 3.081-11.738 5.106-0.312 1.276 1.191 4.037 6.37 7.806 7.945 5.787 15.929 8.837 23.729 8.837 13.121 0 22.24-8.455 23.242-12.157l0.722-1.94h2.231c1.086 0 2.519 0.198 2.98 2.033 0.722 2.878 0.163 13.392-8.082 20.117 6.533-2.962 11.927-6.096 15.594-8.225 3.702-2.149 4.82-2.799 6.105-2.799l2.036 0.076 0.772 1.724c0.982 2.182-0.163 3.475-5.65 9.661-19.17 21.585-35.763 25.578-52.484 28.019-6.3 0.917-11.237 3.081-11.738 5.106-0.312 1.276 1.191 4.037 6.37 7.806 7.945 5.787 15.929 8.837 23.729 8.837 13.121 0 22.24-8.455 23.242-12.157l0.722-1.94h2.231c1.086 0 2.519 0.198 2.98 2.033 0.816 3.25 0.017 16.261-11.682 22.526-5.72 3.064-14.554 4.75-24.876 4.75-27.157 0-56.996-10.645-80.124-28.593-3.215 6.568-2.68 40.648-2.318 63.569 0.070 4.389 0.128 8.458 0.172 12.227 6.437 4.879 13.007 10.87 19.103 18.067 12.308 14.534 26.056 38.457 24.926 71.882 19.508 12.582 36.212 23.959 46.126 31.639-1.949-6.574-1.957-10.96-0.122-13.741 0.871-1.319 2.575-2.889 5.755-2.889 3.064 0 7.069 1.523 12.241 4.657 40.584 24.585 150.326 171.247 174.008 226.096 1.812 4.194 3.952 8.825 6.259 13.82 14.106 30.521 33.422 72.319 25.424 111.37-5.42 26.254-12.981 43.301-26.964 60.811-2.342 2.927-5.1 5.633-8.018 8.496-9.373 9.192-19.060 18.699-16.095 36.896 8.406 51.675 33.095 59.815 70.466 72.141 8.93 2.945 18.166 5.991 28.185 9.917 3.769 1.477 7.992 3.664 12.466 5.977 9.99 5.164 21.308 11.018 31.26 11.018 1.596 0 3.131-0.154 4.561-0.46l0.728-0.079c1.331 0 2.543 0.757 3.163 1.975 0.612 1.171 0.897 3.172-1.159 5.997zM686.525 84.112c-26.991 0-56.629-10.517-79.589-28.191-1.255 2.726-2.254 9.233-3.058 18.043 0.606-0.015 1.223-0.038 1.82-0.038 11.898 0 20.522 2.514 29.653 5.176 10.57 3.081 21.501 6.265 39.354 6.265 3.317 0 6.818-0.114 10.407-0.338 3.25-0.204 6.437-0.673 9.542-1.308-2.581 0.253-5.292 0.39-8.129 0.39z" />
<glyph unicode="&#xf112;" glyph-name="quill" d="M589.812 136.406h-489.656c-55.228 0-100.156-44.928-100.156-100.156v-66.772c0-18.442 14.954-33.386 33.386-33.386h623.198c18.432 0 33.386 14.944 33.386 33.386v66.772c0 55.228-44.928 100.156-100.158 100.156zM1023.386 358.49c-12.15 280.396-251.566 601.428-343.746 601.428-14.888 0-28.604-6.662-38.626-18.77-58.968-71.216 8.738-485.352 54.36-725.888 16.046-84.556 72.972-143.676 141.018-151.32-0.008-0.088-0.018-0.178-0.026-0.27 0.026 0.002 0.054 0.002 0.080 0.004 15.26 170.922-19.63 337.652-61.214 494.076-4.738 17.818 5.866 36.106 23.688 40.842 17.822 4.75 36.106-5.866 40.842-23.688 41.922-157.68 77.252-325.864 64.588-500.724 65.666 28.144 126.448 113.422 119.036 284.31zM835.704 64.716c-0.080-0.216-0.16-0.432-0.254-0.644 0.316-0.038 0.628-0.094 0.944-0.13-2.6-29.246-6.492-58.6-12.252-88.064-3.544-18.096 8.26-35.624 26.344-39.168 2.174-0.422 4.324-0.63 6.454-0.63 15.626 0 29.604 11.064 32.712 26.996 7.28 37.224 11.918 74.172 14.586 110.844-0.872-0.226-19.518-14.858-68.534-9.204zM456.27 326.462v43.644c0 18.442-14.954 33.386-33.386 33.386h-155.8c-18.432 0-33.386-14.944-33.386-33.386v-43.644c-64.652-19.102-116.34-64.644-144.24-123.284h511.052c-27.896 58.644-79.588 104.186-144.24 123.284z" />
<glyph unicode="&#xf122;" glyph-name="quill-drop" d="M589.82 136.4h-489.66c-55.228 0-100.156-44.928-100.156-100.156v-66.772c0-18.442 14.954-33.386 33.386-33.386h623.2c18.432 0 33.386 14.944 33.386 33.386v66.772c0 55.228-44.928 100.156-100.158 100.156zM1023.38 358.48c-12.15 280.4-251.56 601.42-343.74 601.42-14.888 0-28.604-6.662-38.626-18.77-58.968-71.216 8.738-485.36 54.36-725.88 16.046-84.556 72.972-143.676 141.018-151.32-0.008-0.088-0.018-0.178-0.026-0.27 0.026 0.002 0.054 0.002 0.080 0.004 15.26 170.922-19.63 337.66-61.214 494.080-4.738 17.818 5.866 36.106 23.688 40.842 17.822 4.75 36.106-5.866 40.842-23.688 41.922-157.68 77.252-325.86 64.588-500.72 65.666 28.144 126.448 113.422 119.036 284.32zM835.7 64.72c-0.080-0.216-0.16-0.432-0.254-0.644 0.316-0.038 0.628-0.094 0.944-0.13-2.6-29.246-6.492-58.6-12.252-88.064-3.544-18.096 8.26-35.624 26.344-39.168 2.174-0.422 4.324-0.63 6.454-0.63 15.626 0 29.604 11.064 32.712 26.996 7.28 37.224 11.918 74.172 14.586 110.844-0.872-0.226-19.518-14.858-68.534-9.204zM456.28 326.46v43.644c0 18.442-14.954 33.386-33.386 33.386h-155.8c-18.432 0-33.386-14.944-33.386-33.386v-43.644c-64.652-19.102-116.34-64.644-144.24-123.284h511.060c-27.896 58.644-79.588 104.186-144.24 123.284zM433.158 613.24c0 17.519-5.802 54.563-29.912 89.374-20.818 30.057-54.77 110.235-54.77 110.235s-32.329-80.18-53.146-110.235c-24.11-34.812-29.912-71.857-29.912-89.374 0-46.227 37.040-83.795 83.057-84.666v-0.020c0.271 0 0.541 0.008 0.812 0.010 0.271-0.003 0.541-0.010 0.813-0.010v0.020c46.019 0.866 83.057 38.436 83.057 84.666z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Binary file not shown.