Skip to content
This repository was archived by the owner on Apr 7, 2020. It is now read-only.

Commit 734ebe6

Browse files
fix #5
remove condition that break the update of the local tasks
1 parent ded27c4 commit 734ebe6

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

bugboard/management/commands/updatebbdb.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def update_project_details(self, project):
209209
"""Get project content, create a Project object, and save it in db.
210210
211211
Arguments:
212-
project {integer} -- Id of project..
212+
project {integer} -- Id of project.
213213
"""
214214
p = self.get_data(self.api_base + "projects/" + str(project["id"]) + ".json")
215215
p = p["project"] # initial json is like {project:{all the stuff}}
@@ -274,21 +274,21 @@ def update_task_details(self, id_project, t):
274274
task = Task.objects.get(id_task=t["id"])
275275

276276
# update values that can be updated only if last update is more recent thant stored data
277-
if (
278-
pytz.UTC.fromutc(
279-
(
280-
datetime.datetime.strptime(
281-
t["updated_at"], "%Y-%m-%dT%H:%M:%S.%fZ"
282-
)
283-
)
284-
)
285-
> task.updated_at
286-
):
287-
task.priority = t.get("priority", task.priority)
288-
task.priority_id = t["priority_id"]
289-
task.status_id = t["status_id"]
290-
task.status = t.get("status", task.status)
291-
task.admin_link = t.get("admin_link", task.admin_link)
277+
# if (
278+
# pytz.UTC.fromutc(
279+
# (
280+
# datetime.datetime.strptime(
281+
# t["updated_at"], "%Y-%m-%dT%H:%M:%S.%fZ"
282+
# )
283+
# )
284+
# )
285+
# > task.updated_at
286+
# ):
287+
task.priority = t.get("priority", task.priority)
288+
task.priority_id = t["priority_id"]
289+
task.status_id = t["status_id"]
290+
task.status = t.get("status", task.status)
291+
task.admin_link = t.get("admin_link", task.admin_link)
292292

293293
# or create it if it doesn't exist
294294
except Task.DoesNotExist:
@@ -312,7 +312,7 @@ def update_task_details(self, id_project, t):
312312
),
313313
local_task_id=t["local_task_id"],
314314
priority_id=t["priority_id"],
315-
priority=t.get("priority_id", None),
315+
priority=t.get("priority", t["priority_id"]),
316316
status_id=t["status_id"],
317317
status=t.get("status_id", None),
318318
description=t["description"],

bugboard/templates/bugboard/task_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h6 class="card-subtitle mb-2 text-muted">
3939
<!-- get_priority_display -->
4040
{% if task.priority_id == 1 or task.priority_id == 2 %}
4141
<span class="badge badge-danger font-size-lg">
42-
{{ task.priority|title }}
42+
{{ task.priority }}
4343
</span>
4444
{% endif %}
4545
</h6>

0 commit comments

Comments
 (0)