Skip to content

Commit

Permalink
[api] fix create at time parsing from bugzilla
Browse files Browse the repository at this point in the history
and use Time.now as fallback to avoid missing data.
  • Loading branch information
adrianschroeter committed Jan 19, 2017
1 parent 119c42e commit a8970e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/api/app/models/issue_tracker.rb
Expand Up @@ -217,7 +217,11 @@ def parse_single_bugzilla_issue(r)
u = User.find_by_email(r["assigned_to"].to_s)
logger.info "Bugzilla user #{r["assigned_to"]} is not found in OBS user database" unless u
issue.owner_id = u.id if u
issue.created_at = r["creation_time"]
# rubocop:disable Rails/Date
# the warning regarding timezone is pointless since the object got no information either
issue.created_at = r["creation_time"].to_time if r["creation_time"].present?
# rubocop:enable Rails/Date
issue.created_at ||= Time.now
# this is our update_at, not the one bugzilla logged in last_change_time
issue.updated_at = @update_time_stamp
if r["is_private"]
Expand Down

0 comments on commit a8970e7

Please sign in to comment.