Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_date(self):
return lmdutils.get_date_from_timestamp(self.date)
rev = PHAB_URL_PAT.search(phab_url).group(1)
r = requests.post(
PHAB_API,
data={
"api.token": self.phab_token,
"queryKey": "all",
"constraints[ids][0]": rev,
"attachments[reviewers]": 1,
},
)
r.raise_for_status()
data = r.json()["result"]["data"][0]
# this is a timestamp
last_modified = data["fields"]["dateModified"]
last_modified = lmdutils.get_date_from_timestamp(last_modified)
if (self.date - last_modified).days <= self.nweeks * 7:
# Do not do anything if recent changes in the bug
return False
reviewers = data["attachments"]["reviewers"]["reviewers"]
if not reviewers:
return False
for reviewer in reviewers:
if reviewer["status"] != "accepted":
return False
value = data["fields"]["status"].get("value", "")
if value == "changes-planned":
# even if the patch is r+ and not published, some changes may be required
# so with the value 'changes-planned', the dev can say it's still a wip
def get_date(self):
return lmdutils.get_date_from_timestamp(self.date)