Skip to content
Permalink
Browse files

fix: wiki not displaying cloud history

when generating the assignments page we were using the data from
the schedule in that day. Turns out the schedule  object maps to
the cloud object which is constantly being modified as we do for
defining new clouds.
added a fix to look for the first cloudhistory object with the same
cloud name, that has been created right before the schedule object.

closes: #297
Change-Id: I2431a868d539a4636407ae96505119b66cab4f36
  • Loading branch information
grafuls committed Nov 22, 2019
1 parent fce21f2 commit 897ae43b35d71ba72abd754a8d894f799a1da03a
Showing with 12 additions and 4 deletions.
  1. +12 −4 quads/tools/simple_table_generator.py
@@ -6,7 +6,7 @@
from datetime import datetime
from jinja2 import Template
from quads.config import conf, TEMPLATES_PATH
from quads.model import Schedule, Host
from quads.model import Schedule, Host, Cloud, CloudHistory


def generator(_host_file, _days, _month, _year, _gentime):
@@ -41,9 +41,17 @@ def generator(_host_file, _days, _month, _year, _gentime):
}

if schedule:
_day["display_description"] = schedule.cloud.description
_day["display_owner"] = schedule.cloud.owner
_day["display_ticket"] = schedule.cloud.ticket
cloud = CloudHistory.objects(
__raw__={
"_id": {
"$lt": schedule.id
},
"name": schedule.cloud.name
}
).order_by("-_id").first()
_day["display_description"] = cloud.description
_day["display_owner"] = cloud.owner
_day["display_ticket"] = cloud.ticket
__days.append(_day)

line["days"] = __days

0 comments on commit 897ae43

Please sign in to comment.
You can’t perform that action at this time.