Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
Handle submissions made by deleted users
Dieser Commit ist enthalten in:
Ursprung
dcee0b3774
Commit
af613c11d6
2 geänderte Dateien mit 12 neuen und 1 gelöschten Zeilen
|
@ -1,4 +1,9 @@
|
|||
en:
|
||||
admin:
|
||||
wizard:
|
||||
submissions:
|
||||
no_user: "deleted (id: %{id})"
|
||||
|
||||
wizard:
|
||||
custom_title: "Wizard"
|
||||
field:
|
||||
|
|
|
@ -148,7 +148,13 @@ class CustomWizard::AdminController < ::ApplicationController
|
|||
|
||||
all_submissions = [*rows].map do |r|
|
||||
submissions = ::JSON.parse(r.value)
|
||||
username = User.find(r.key).username
|
||||
|
||||
if user = User.find_by(id: r.key)
|
||||
username = user.username
|
||||
else
|
||||
username = I18n.t('admin.wizard.submissions.no_user', id: r.key)
|
||||
end
|
||||
|
||||
submissions.map { |s| { username: username }.merge!(s.except("redirect_to")) }
|
||||
end.flatten
|
||||
|
||||
|
|
Laden …
In neuem Issue referenzieren