Skip to content

Commit 3954769

Browse files
committed
chore: pre-commit
1 parent 56cfced commit 3954769

20 files changed

+838
-1245
lines changed

src/js/src/openapi.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,7 @@
15241524
"name": "sortOrder",
15251525
"in": "query",
15261526
"schema": {
1527-
"type": ["string", "null"],
1527+
"type": ["null", "string"],
15281528
"enum": ["asc", "desc", null],
15291529
"title": "Field to search",
15301530
"default": "desc"
@@ -1796,7 +1796,7 @@
17961796
"name": "sortOrder",
17971797
"in": "query",
17981798
"schema": {
1799-
"type": ["string", "null"],
1799+
"type": ["null", "string"],
18001800
"enum": ["asc", "desc", null],
18011801
"title": "Field to search",
18021802
"default": "asc"
@@ -3530,7 +3530,7 @@
35303530
"name": "sortOrder",
35313531
"in": "query",
35323532
"schema": {
3533-
"type": ["string", "null"],
3533+
"type": ["null", "string"],
35343534
"enum": ["asc", "desc", null],
35353535
"title": "Field to search",
35363536
"default": "desc"

src/py/app/server/templates/emails/email_verification.html.j2

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@
7373
<div class="content">
7474
<h2>Welcome{{ ' ' + user.name if user.name else '' }}!</h2>
7575
<p>Thanks for signing up for {{ app_name }}. To complete your registration, please verify your email address by clicking the button below:</p>
76-
76+
7777
<div style="text-align: center;">
7878
<a href="{{ verification_url }}" class="button">Verify Email Address</a>
7979
</div>
80-
80+
8181
<p>Or copy and paste this URL into your browser:</p>
8282
<div class="url-box">{{ verification_url }}</div>
83-
83+
8484
<p><strong>This link will expire in {{ expires_in_hours }} hours.</strong></p>
85-
85+
8686
<p>If you didn't create an account with {{ app_name }}, please ignore this email.</p>
87-
87+
8888
<p>Need help? Contact our support team if you have any questions.</p>
8989
</div>
9090
<div class="footer">
@@ -93,4 +93,4 @@
9393
</div>
9494
</div>
9595
</body>
96-
</html>
96+
</html>

src/py/app/server/templates/emails/email_verification.txt.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ Best regards,
1616
{{ app_name }} Team
1717

1818
--
19-
This is an automated email. Please do not reply to this message.
19+
This is an automated email. Please do not reply to this message.

src/py/app/server/templates/emails/team_invitation.html.j2

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,22 @@
8585
</div>
8686
<div class="content">
8787
<h2>Join a team on {{ app_name }}</h2>
88-
88+
8989
<p><strong>{{ inviter_name }}</strong> has invited you to join their team:</p>
90-
90+
9191
<div class="team-info">
9292
<div class="team-name">{{ team_name }}</div>
9393
</div>
94-
94+
9595
<p>By joining this team, you'll be able to collaborate with other team members, share resources, and work together on {{ app_name }}.</p>
96-
96+
9797
<div style="text-align: center;">
9898
<a href="{{ invitation_url }}" class="button">Accept Invitation</a>
9999
</div>
100-
100+
101101
<p>Or copy and paste this URL into your browser:</p>
102102
<div class="url-box">{{ invitation_url }}</div>
103-
103+
104104
<p>If you don't want to join this team or don't know {{ inviter_name }}, you can safely ignore this email.</p>
105105
</div>
106106
<div class="footer">
@@ -109,4 +109,4 @@
109109
</div>
110110
</div>
111111
</body>
112-
</html>
112+
</html>

src/py/app/server/templates/emails/team_invitation.txt.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ If you don't want to join this team or don't know {{ inviter_name }}, you can sa
1313

1414
--
1515
This invitation was sent to you by {{ inviter_name }}.
16-
{{ app_name }}
16+
{{ app_name }}

src/py/app/server/templates/emails/welcome.html.j2

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@
7777
<div class="content">
7878
<h2>Hi{{ ' ' + user.name if user.name else '' }}!</h2>
7979
<p>Congratulations! Your email has been verified and your account is now fully activated.</p>
80-
80+
8181
<p>You're all set to start using {{ app_name }}. Here's what you can do next:</p>
82-
82+
8383
<div class="feature-list">
8484
<ul>
8585
<li>Complete your profile to personalize your experience</li>
@@ -88,13 +88,13 @@
8888
<li>Start creating and collaborating</li>
8989
</ul>
9090
</div>
91-
91+
9292
<div style="text-align: center;">
9393
<a href="{{ login_url }}" class="button">Log In to Your Account</a>
9494
</div>
95-
95+
9696
<p>If you have any questions or need assistance, our support team is here to help!</p>
97-
97+
9898
<p>Thanks for joining us,<br>
9999
The {{ app_name }} Team</p>
100100
</div>
@@ -104,4 +104,4 @@
104104
</div>
105105
</div>
106106
</body>
107-
</html>
107+
</html>

src/py/app/server/templates/emails/welcome.txt.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ Thanks for joining us,
1919
The {{ app_name }} Team
2020

2121
--
22-
You're receiving this email because you recently created an account.
22+
You're receiving this email because you recently created an account.

src/py/tests/conftest.py

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,26 @@
33
import os
44

55
# Set test environment before any other imports
6-
os.environ.update({
7-
"SECRET_KEY": "secret-key",
8-
"DATABASE_URL": "sqlite+aiosqlite:///:memory:",
9-
"DATABASE_ECHO": "false",
10-
"DATABASE_ECHO_POOL": "false",
11-
"VALKEY_PORT": "6308",
12-
"REDIS_URL": "redis://localhost:6308/0",
13-
"SAQ_USE_SERVER_LIFESPAN": "False",
14-
"SAQ_WEB_ENABLED": "True",
15-
"SAQ_BACKGROUND_WORKERS": "1",
16-
"SAQ_CONCURRENCY": "1",
17-
"VITE_HOST": "localhost",
18-
"VITE_PORT": "3006",
19-
"VITE_HOT_RELOAD": "True",
20-
"VITE_DEV_MODE": "True",
21-
"VITE_USE_SERVER_LIFESPAN": "False",
22-
"EMAIL_ENABLED": "false",
23-
})
6+
os.environ.update(
7+
{
8+
"SECRET_KEY": "secret-key",
9+
"DATABASE_URL": "sqlite+aiosqlite:///:memory:",
10+
"DATABASE_ECHO": "false",
11+
"DATABASE_ECHO_POOL": "false",
12+
"VALKEY_PORT": "6308",
13+
"REDIS_URL": "redis://localhost:6308/0",
14+
"SAQ_USE_SERVER_LIFESPAN": "False",
15+
"SAQ_WEB_ENABLED": "True",
16+
"SAQ_BACKGROUND_WORKERS": "1",
17+
"SAQ_CONCURRENCY": "1",
18+
"VITE_HOST": "localhost",
19+
"VITE_PORT": "3006",
20+
"VITE_HOT_RELOAD": "True",
21+
"VITE_DEV_MODE": "True",
22+
"VITE_USE_SERVER_LIFESPAN": "False",
23+
"EMAIL_ENABLED": "false",
24+
}
25+
)
2426

2527
from typing import TYPE_CHECKING
2628
from uuid import uuid4
@@ -57,7 +59,6 @@ def anyio_backend() -> str:
5759
@pytest.fixture(autouse=True)
5860
def _patch_settings(monkeypatch: MonkeyPatch) -> None:
5961
"""Patch the settings - environment already set at module level."""
60-
pass
6162

6263

6364
@pytest.fixture(name="engine")
@@ -111,9 +112,11 @@ async def session(sessionmaker: async_sessionmaker[AsyncSession]) -> AsyncGenera
111112
def app():
112113
"""Create Litestar app for testing."""
113114
import os
115+
114116
os.environ.setdefault("DATABASE_URL", "sqlite:///:memory:")
115-
117+
116118
from app.server.asgi import create_app
119+
117120
return create_app()
118121

119122

@@ -128,6 +131,7 @@ async def client(app: Litestar) -> AsyncGenerator[AsyncTestClient, None]:
128131
async def user_service(sessionmaker: async_sessionmaker[AsyncSession]):
129132
"""Create UserService instance."""
130133
from app.services import UserService
134+
131135
async with UserService.new(sessionmaker()) as service:
132136
yield service
133137

@@ -136,6 +140,7 @@ async def user_service(sessionmaker: async_sessionmaker[AsyncSession]):
136140
async def team_service(sessionmaker: async_sessionmaker[AsyncSession]):
137141
"""Create TeamService instance."""
138142
from app.services import TeamService
143+
139144
async with TeamService.new(sessionmaker()) as service:
140145
yield service
141146

@@ -145,7 +150,7 @@ async def test_user(session: AsyncSession):
145150
"""Create a test user."""
146151
from app.db import models as m
147152
from app.lib.crypt import get_password_hash
148-
153+
149154
user = m.User(
150155
id=uuid4(),
151156
@@ -165,7 +170,7 @@ async def admin_user(session: AsyncSession):
165170
"""Create an admin user."""
166171
from app.db import models as m
167172
from app.lib.crypt import get_password_hash
168-
173+
169174
user = m.User(
170175
id=uuid4(),
171176
@@ -187,7 +192,7 @@ async def test_team(session: AsyncSession, test_user):
187192
from app.db import models as m
188193
from app.db.models.team_member import TeamMember
189194
from app.db.models.team_roles import TeamRoles
190-
195+
191196
team = m.Team(
192197
id=uuid4(),
193198
name="Test Team",
@@ -247,6 +252,7 @@ async def admin_client(client: AsyncTestClient, admin_user) -> AsyncTestClient:
247252
async def email_verification_service(sessionmaker: async_sessionmaker[AsyncSession]):
248253
"""Create EmailVerificationTokenService instance."""
249254
from app.services import EmailVerificationTokenService
255+
250256
async with EmailVerificationTokenService.new(sessionmaker()) as service:
251257
yield service
252258

@@ -255,6 +261,7 @@ async def email_verification_service(sessionmaker: async_sessionmaker[AsyncSessi
255261
async def password_reset_service(sessionmaker: async_sessionmaker[AsyncSession]):
256262
"""Create PasswordResetService instance."""
257263
from app.services import PasswordResetService
264+
258265
async with PasswordResetService.new(sessionmaker()) as service:
259266
yield service
260267

@@ -263,6 +270,7 @@ async def password_reset_service(sessionmaker: async_sessionmaker[AsyncSession])
263270
async def role_service(sessionmaker: async_sessionmaker[AsyncSession]):
264271
"""Create RoleService instance."""
265272
from app.services import RoleService
273+
266274
async with RoleService.new(sessionmaker()) as service:
267275
yield service
268276

@@ -271,6 +279,7 @@ async def role_service(sessionmaker: async_sessionmaker[AsyncSession]):
271279
async def tag_service(sessionmaker: async_sessionmaker[AsyncSession]):
272280
"""Create TagService instance."""
273281
from app.services import TagService
282+
274283
async with TagService.new(sessionmaker()) as service:
275284
yield service
276285

@@ -279,6 +288,7 @@ async def tag_service(sessionmaker: async_sessionmaker[AsyncSession]):
279288
async def team_member_service(sessionmaker: async_sessionmaker[AsyncSession]):
280289
"""Create TeamMemberService instance."""
281290
from app.services import TeamMemberService
291+
282292
async with TeamMemberService.new(sessionmaker()) as service:
283293
yield service
284294

@@ -287,6 +297,7 @@ async def team_member_service(sessionmaker: async_sessionmaker[AsyncSession]):
287297
async def team_invitation_service(sessionmaker: async_sessionmaker[AsyncSession]):
288298
"""Create TeamInvitationService instance."""
289299
from app.services import TeamInvitationService
300+
290301
async with TeamInvitationService.new(sessionmaker()) as service:
291302
yield service
292303

@@ -295,6 +306,7 @@ async def team_invitation_service(sessionmaker: async_sessionmaker[AsyncSession]
295306
async def user_role_service(sessionmaker: async_sessionmaker[AsyncSession]):
296307
"""Create UserRoleService instance."""
297308
from app.services import UserRoleService
309+
298310
async with UserRoleService.new(sessionmaker()) as service:
299311
yield service
300312

@@ -303,6 +315,7 @@ async def user_role_service(sessionmaker: async_sessionmaker[AsyncSession]):
303315
async def user_oauth_service(sessionmaker: async_sessionmaker[AsyncSession]):
304316
"""Create UserOAuthAccountService instance."""
305317
from app.services import UserOAuthAccountService
318+
306319
async with UserOAuthAccountService.new(sessionmaker()) as service:
307320
yield service
308321

@@ -311,6 +324,7 @@ async def user_oauth_service(sessionmaker: async_sessionmaker[AsyncSession]):
311324
def email_service():
312325
"""Create EmailService instance for testing."""
313326
from app.lib.email import EmailService
327+
314328
return EmailService()
315329

316330

@@ -320,7 +334,7 @@ async def unverified_user(session: AsyncSession):
320334
"""Create an unverified user."""
321335
from app.db import models as m
322336
from app.lib.crypt import get_password_hash
323-
337+
324338
user = m.User(
325339
id=uuid4(),
326340
@@ -340,7 +354,7 @@ async def inactive_user(session: AsyncSession):
340354
"""Create an inactive user."""
341355
from app.db import models as m
342356
from app.lib.crypt import get_password_hash
343-
357+
344358
user = m.User(
345359
id=uuid4(),
346360
@@ -359,7 +373,7 @@ async def inactive_user(session: AsyncSession):
359373
async def test_role(session: AsyncSession):
360374
"""Create a test role."""
361375
from app.db import models as m
362-
376+
363377
role = m.Role(
364378
id=uuid4(),
365379
name="test_role",
@@ -376,7 +390,7 @@ async def test_role(session: AsyncSession):
376390
async def test_tag(session: AsyncSession):
377391
"""Create a test tag."""
378392
from app.db import models as m
379-
393+
380394
tag = m.Tag(
381395
id=uuid4(),
382396
name="test_tag",
@@ -393,6 +407,7 @@ async def test_tag(session: AsyncSession):
393407
async def test_verification_token(session: AsyncSession, unverified_user):
394408
"""Create a test email verification token."""
395409
from datetime import UTC, datetime, timedelta
410+
396411
from app.db import models as m
397412

398413
token = m.EmailVerificationToken(
@@ -411,6 +426,7 @@ async def test_verification_token(session: AsyncSession, unverified_user):
411426
async def test_password_reset_token(session: AsyncSession, test_user):
412427
"""Create a test password reset token."""
413428
from datetime import UTC, datetime, timedelta
429+
414430
from app.db import models as m
415431

416432
token = m.PasswordResetToken(
@@ -431,6 +447,7 @@ async def test_password_reset_token(session: AsyncSession, test_user):
431447
async def test_oauth_account(session: AsyncSession, test_user):
432448
"""Create a test OAuth account."""
433449
from datetime import UTC, datetime, timedelta
450+
434451
from app.db import models as m
435452

436453
oauth_account = m.UserOauthAccount(
@@ -459,6 +476,7 @@ async def test_oauth_account(session: AsyncSession, test_user):
459476
async def test_team_invitation(session: AsyncSession, test_team, test_user):
460477
"""Create a test team invitation."""
461478
from datetime import UTC, datetime, timedelta
479+
462480
from app.db import models as m
463481

464482
invitation = m.TeamInvitation(

0 commit comments

Comments
 (0)