Skip to content

Commit

Permalink
Merge pull request #28 from datacite/bug_variousfixes
Browse files Browse the repository at this point in the history
Bug variousfixes
  • Loading branch information
kjgarza authored May 28, 2018
2 parents 148b5f5 + 16b012c commit dbc6a67
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
5 changes: 3 additions & 2 deletions app/models/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class Report < ApplicationRecord
serialize :exceptions, Array
before_create :set_id
before_validation :set_uid, on: :create
after_create :push_report
after_save :push_report


def push_report
logger.warn "calling queue for " + uid
queue_report if ENV["AWS_REGION"]
queue_report if ENV["AWS_REGION"].present?
end

private
Expand All @@ -44,6 +44,7 @@ def set_id
end

def set_uid
return ActionController::ParameterMissing if self.reporting_period.nil?
self.uid = SecureRandom.uuid if uid.blank?
month = Date.strptime(self.reporting_period["begin_date"],"%Y-%m-%d").month.to_s
year = Date.strptime(self.reporting_period["begin_date"],"%Y-%m-%d").year.to_s
Expand Down
15 changes: 0 additions & 15 deletions app/models/status_alerts.rb

This file was deleted.

7 changes: 7 additions & 0 deletions lib/sushi_schema/sushi_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@
"items" : {
"$ref" : "#/definitions/sushi_report_header_report_attributes"
}
},
"reporting-period" : {
"type" : "object",
"description" : "time the report is about. format as defined by date-time - rfc3339",
"items" : {
"$ref" : "#/definitions/counter_dataset_performance_period"
}
}
},
"description" : "generalized report header that defines the requested report, the requestor, the customer, filters applied, reportattributes applied and any exceptions.",
Expand Down

0 comments on commit dbc6a67

Please sign in to comment.