aliases/implications: remove 'error' state.
Remove the error status from aliases and implications. Aliases and implications normally shouldn't fail because they're validated beforehand. If they do, just let the delayed job itself record the failure. Also disable the delayed job from retrying if the alias/implication somehow fails.
This commit is contained in:
@@ -12,9 +12,6 @@ class TagAlias < TagRelationship
|
||||
|
||||
def process!
|
||||
TagMover.new(antecedent_name, consequent_name, user: User.system).move!
|
||||
rescue Exception => e
|
||||
update!(status: "error: #{e}")
|
||||
DanbooruLogger.log(e, tag_alias_id: id, antecedent_name: antecedent_name, consequent_name: consequent_name)
|
||||
end
|
||||
|
||||
def absence_of_transitive_relation
|
||||
|
||||
@@ -113,9 +113,6 @@ class TagImplication < TagRelationship
|
||||
CurrentUser.scoped(User.system) do
|
||||
update_posts
|
||||
end
|
||||
rescue Exception => e
|
||||
update(status: "error: #{e}")
|
||||
DanbooruLogger.log(e, tag_implication_id: id, antecedent_name: antecedent_name, consequent_name: consequent_name)
|
||||
end
|
||||
|
||||
def create_mod_action
|
||||
|
||||
@@ -20,7 +20,7 @@ class TagRelationship < ApplicationRecord
|
||||
scope :retired, -> {where(status: "retired")}
|
||||
|
||||
before_validation :normalize_names
|
||||
validates_format_of :status, :with => /\A(active|deleted|retired|error: .*)\Z/
|
||||
validates :status, inclusion: { in: %w[active deleted retired] }
|
||||
validates_presence_of :antecedent_name, :consequent_name
|
||||
validates :approver, presence: { message: "must exist" }, if: -> { approver_id.present? }
|
||||
validates :forum_topic, presence: { message: "must exist" }, if: -> { forum_topic_id.present? }
|
||||
@@ -47,10 +47,6 @@ class TagRelationship < ApplicationRecord
|
||||
status == "active"
|
||||
end
|
||||
|
||||
def is_errored?
|
||||
status =~ /\Aerror:/
|
||||
end
|
||||
|
||||
def reject!
|
||||
update!(status: "deleted")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user