mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
Skip validations when creating a post by system user.
This commit is contained in:
parent
5fe4837e28
commit
4aa3442824
1 changed files with 3 additions and 2 deletions
|
@ -47,12 +47,13 @@ class SystemMessage
|
||||||
title = I18n.t("system_messages.#{type}.subject_template", params)
|
title = I18n.t("system_messages.#{type}.subject_template", params)
|
||||||
raw = I18n.t("system_messages.#{type}.text_body_template", params)
|
raw = I18n.t("system_messages.#{type}.text_body_template", params)
|
||||||
|
|
||||||
PostCreator.create(Discourse.system_user,
|
PostCreator.create!(Discourse.system_user,
|
||||||
title: title,
|
title: title,
|
||||||
raw: raw,
|
raw: raw,
|
||||||
archetype: Archetype.private_message,
|
archetype: Archetype.private_message,
|
||||||
target_usernames: @recipient.username,
|
target_usernames: @recipient.username,
|
||||||
subtype: TopicSubtype.system_message)
|
subtype: TopicSubtype.system_message,
|
||||||
|
skip_validations: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def defaults
|
def defaults
|
||||||
|
|
Loading…
Reference in a new issue