Commit 07c57b06 authored by Tom Pillot's avatar Tom Pillot

Fix update

parent 824aee99
Pipeline #10595 passed with stage
in 3 minutes and 52 seconds
......@@ -24,7 +24,7 @@ def update_issues_pr():
# Create new issues and pull requests
for issue in gh.get_issues(state='open'):
days_since_updated = (timezone.now() - issue.updated_at).days
days_since_updated = (timezone.now() - timezone.make_aware(issue.updated_at)).days
if main_repo is not None and days_since_updated > MIN_DAYS_SINCE_UPDATED \
and SKIP_LABEL not in [label.name for label in issue.get_labels()]:
url = re.sub('api\\.github\\.com/repos', 'github.com', issue.url)
......
......@@ -682,7 +682,7 @@ class IssuePr(models.Model):
def update(self, skip_label):
gh = self.repo.project.github()
issue_pr = gh.get_issue(number=self.number) if self.is_issue else gh.get_pull(number=self.number)
self.days_since_updated = (timezone.now() - issue_pr.updated_at).days
self.days_since_updated = (timezone.now() - timezone.make_aware(issue_pr.updated_at)).days
if issue_pr.state == 'closed' or skip_label in [label.name for label in issue_pr.get_labels()]:
self.delete()
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment