Skip to content

Commit

Permalink
Merge pull request #4230 from evanrolfe/fix/create_project_log_entry
Browse files Browse the repository at this point in the history
[webui][api] Fix CreateProjectLogEntryJob when the entry was not persisted
  • Loading branch information
Moisés Déniz Alemán committed Dec 19, 2017
2 parents 77ecab5 + 2cde871 commit 18f40e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/api/app/jobs/create_project_log_entry_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ class CreateProjectLogEntryJob < ApplicationJob

def perform(event_id)
event = Event::Base.find(event_id)
entry = ProjectLogEntry.create_from(event)
event.update_attributes(project_logged: true) if entry.persisted?
# If the ProjectLogEntry was invalid then we still mark the event as logged
event.update_attributes(project_logged: true)

ProjectLogEntry.create_from(event)
end
end

0 comments on commit 18f40e2

Please sign in to comment.