CRUSHED: duplicate key value violates unique constraint 'index_uploads_on_sha1'

This commit is contained in:
Régis Hanol
2015-05-07 01:00:13 +02:00
parent 52c19d74f8
commit 9a96cd9f3b
3 changed files with 29 additions and 23 deletions

View File

@ -256,7 +256,7 @@ module Discourse
user ||= User.admins.real.order(:id).first
end
SYSTEM_USER_ID = -1 unless defined? SYSTEM_USER_ID
SYSTEM_USER_ID ||= -1
def self.system_user
User.find_by(id: SYSTEM_USER_ID)