Skip to content

Commit ff2ffb1

Browse files
committed
make format
1 parent b55881f commit ff2ffb1

File tree

10 files changed

+35
-24
lines changed

10 files changed

+35
-24
lines changed

intbot/core/bot/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ async def inbox(ctx):
6767
user_id = str(ctx.message.author.id)
6868
inbox_items = InboxItem.objects.filter(user_id=user_id).order_by("-created_at")
6969

70-
7170
# Use async query
7271
if not await inbox_items.aexists():
7372
await ctx.send("Your inbox is empty.")

intbot/core/integrations/zammad.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class ZammadConfig:
1414
sponsors_group = settings.ZAMMAD_GROUP_SPONSORS
1515
grants_group = settings.ZAMMAD_GROUP_GRANTS
1616

17+
1718
class ZammadGroup(BaseModel):
1819
id: int
1920
name: str
@@ -56,7 +57,6 @@ class ZammadWebhook(BaseModel):
5657

5758

5859
class ZammadParser:
59-
6060
class Actions:
6161
new_ticket_created = "new_ticket_created"
6262
new_message_in_thread = "new_message_in_thread"
@@ -142,7 +142,9 @@ def to_discord_message(self):
142142

143143
action = actions[self.action]
144144

145-
return message(group=self.group, sender=self.updated_by, action=action, details=self.url)
145+
return message(
146+
group=self.group, sender=self.updated_by, action=action, details=self.url
147+
)
146148

147149
def meta(self):
148150
return {

intbot/core/migrations/0004_add_inbox_item_model.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,32 @@
55

66

77
class Migration(migrations.Migration):
8-
98
dependencies = [
10-
('core', '0003_added_extra_field_to_webhook'),
9+
("core", "0003_added_extra_field_to_webhook"),
1110
]
1211

1312
operations = [
1413
migrations.CreateModel(
15-
name='InboxItem',
14+
name="InboxItem",
1615
fields=[
17-
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18-
('uuid', models.UUIDField(default=uuid.uuid4)),
19-
('message_id', models.CharField(max_length=255)),
20-
('channel_id', models.CharField(max_length=255)),
21-
('channel_name', models.CharField(max_length=255)),
22-
('server_id', models.CharField(max_length=255)),
23-
('author', models.CharField(max_length=255)),
24-
('user_id', models.CharField(max_length=255)),
25-
('content', models.TextField()),
26-
('created_at', models.DateTimeField(auto_now_add=True)),
16+
(
17+
"id",
18+
models.BigAutoField(
19+
auto_created=True,
20+
primary_key=True,
21+
serialize=False,
22+
verbose_name="ID",
23+
),
24+
),
25+
("uuid", models.UUIDField(default=uuid.uuid4)),
26+
("message_id", models.CharField(max_length=255)),
27+
("channel_id", models.CharField(max_length=255)),
28+
("channel_name", models.CharField(max_length=255)),
29+
("server_id", models.CharField(max_length=255)),
30+
("author", models.CharField(max_length=255)),
31+
("user_id", models.CharField(max_length=255)),
32+
("content", models.TextField()),
33+
("created_at", models.DateTimeField(auto_now_add=True)),
2734
],
2835
),
2936
]

intbot/core/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ def summary(self) -> str:
7878
f"`{timestamp}` | from **{self.author}** @ **{self.channel_name}**: "
7979
f"[{self.content[:30]}...]({self.url()})"
8080
)
81-
81+
8282
def __str__(self):
8383
return f"{self.uuid} {self.author}: {self.content[:30]}"

intbot/intbot/settings.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ def get(name) -> str:
192192
ZAMMAD_GROUP_GRANTS = get("ZAMMAD_GROUP_GRANTS")
193193

194194

195-
196195
if DJANGO_ENV == "dev":
197196
DEBUG = True
198197
ALLOWED_HOSTS = ["127.0.0.1", "localhost"]
@@ -278,8 +277,6 @@ def get(name) -> str:
278277
ZAMMAD_GROUP_BILLING = "TestZammad Billing"
279278

280279

281-
282-
283280
elif DJANGO_ENV == "local_container":
284281
DEBUG = False
285282
ALLOWED_HOSTS = ["127.0.0.1", "localhost"]

intbot/tests/test_bot/test_inbox.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from django.utils import timezone
1313

1414

15-
1615
@pytest.mark.asyncio
1716
@pytest.mark.django_db
1817
async def test_inbox_command_with_empty_inbox():

intbot/tests/test_bot/test_main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ async def test_wiki_command():
3535
suppress_embeds=True,
3636
)
3737

38+
3839
@pytest.mark.asyncio
3940
async def test_close_command_working():
4041
# Mock context
@@ -52,6 +53,7 @@ async def test_close_command_working():
5253
suppress_embeds=True,
5354
)
5455

56+
5557
@pytest.mark.asyncio
5658
async def test_close_command_notworking():
5759
# Mock context
@@ -65,7 +67,7 @@ async def test_close_command_notworking():
6567
ctx.channel.send.assert_called_once_with(
6668
"The !close command is intended to be used inside a thread/post",
6769
suppress_embeds=True,
68-
delete_after=5
70+
delete_after=5,
6971
)
7072

7173

intbot/tests/test_integrations/test_zammad.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import pytest
32
from core.integrations.zammad import ZammadParser, prep_zammad_webhook
43
from core.models import Webhook

intbot/tests/test_tasks.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
import respx
66
from core.integrations.github import GITHUB_API_URL
77
from core.models import DiscordMessage, Webhook
8-
from core.tasks import process_github_webhook, process_internal_webhook, process_webhook, process_zammad_webhook
8+
from core.tasks import (
9+
process_github_webhook,
10+
process_internal_webhook,
11+
process_webhook,
12+
process_zammad_webhook,
13+
)
914
from django.utils import timezone
1015
from django_tasks.task import ResultStatus
1116
from httpx import Response

intbot/tests/test_webhooks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def test_github_webhook_endpoint_checks_authorization_token(client):
8585
assert response.status_code == 403
8686
assert response.content == "X-Hub-Signature-256 is missing".encode("utf-8")
8787

88+
8889
def sign_github_webhook(webhook_body):
8990
hashed = hmac.new(
9091
settings.GITHUB_WEBHOOK_SECRET_TOKEN.encode("utf-8"),

0 commit comments

Comments
 (0)