Skip to content

Commit

Permalink
fix: wiki not displaying cloud history
Browse files Browse the repository at this point in the 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 897ae43
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions quads/tools/simple_table_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 897ae43

Please sign in to comment.