mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
Updates 2.23 (#843)
* pipenv lock and pyupgrade * pyupgrade, black format, add docs * update for py3.7
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import datetime
|
||||
from django.core.management.base import BaseCommand
|
||||
@@ -20,7 +19,7 @@ class Command(BaseCommand):
|
||||
|
||||
def handle(self, *args, **options):
|
||||
client = APIClient(settings.DESKPRO_URL, settings.DESKPRO_KEY)
|
||||
self.log("DESKPRO: {}".format(settings.DESKPRO_URL))
|
||||
self.log(f"DESKPRO: {settings.DESKPRO_URL}")
|
||||
ticket_qs = models.DeskProTicket.objects.filter(
|
||||
published__isnull=True
|
||||
).order_by("created")
|
||||
@@ -30,7 +29,7 @@ class Command(BaseCommand):
|
||||
return
|
||||
|
||||
for ticket in ticket_qs[:10]:
|
||||
self.log("Posting to Deskpro: #{}".format(ticket.id))
|
||||
self.log(f"Posting to Deskpro: #{ticket.id}")
|
||||
|
||||
try:
|
||||
client.create_ticket(ticket)
|
||||
@@ -43,6 +42,6 @@ class Command(BaseCommand):
|
||||
)
|
||||
)
|
||||
ticket.published = datetime.datetime.now().replace(tzinfo=models.UTC())
|
||||
ticket.subject = "[FAILED] {}".format(ticket.subject)
|
||||
ticket.body = "{}\nAPI Delivery Error: {}".format(ticket.body, exc.data)
|
||||
ticket.subject = f"[FAILED] {ticket.subject}"
|
||||
ticket.body = f"{ticket.body}\nAPI Delivery Error: {exc.data}"
|
||||
ticket.save()
|
||||
|
||||
Reference in New Issue
Block a user