Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 73203ab

Browse files
authored
Merge branch 'tough-dev-school:master' into lesson1
2 parents a010229 + 352aa9b commit 73203ab

File tree

22 files changed

+21
-21
lines changed

22 files changed

+21
-21
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ jobs:
2626
run: cp config/.env.template config/.env
2727

2828
- name: Set up QEMU
29-
uses: docker/setup-qemu-action@v2
29+
uses: docker/setup-qemu-action@v3
3030

3131
- name: Set up Docker Buildx
32-
uses: docker/setup-buildx-action@v2
32+
uses: docker/setup-buildx-action@v3
3333

3434
- name: Build the image
35-
uses: docker/bake-action@v3
35+
uses: docker/bake-action@v4
3636
with:
3737
files: docker-compose.yml
3838
targets: web

.importlinter

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ containers =
1616
layers =
1717
(urls) | (admin)
1818
(views)
19-
(infrastructure)
19+
(container)
2020
(logic)
21+
(infrastructure)
2122
(models)
22-
(container)
2323

2424

2525
[importlinter:contract:apps-independence]

server/apps/identity/intrastructure/services/placeholder.py renamed to server/apps/identity/infrastructure/services/placeholder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class UserResponse(pydantic_model.BaseModel):
1717
# TODO: use redis-based caching
1818
@final
1919
class LeadCreate(http.BaseFetcher):
20-
"""Service around creating new users and fething their :term:`lead_id`."""
20+
"""Service around creating new users and fetching their :term:`lead_id`."""
2121

2222
_url_path = '/users'
2323

@@ -33,7 +33,7 @@ def __call__(
3333
timeout=self._api_timeout,
3434
)
3535
response.raise_for_status()
36-
return UserResponse.parse_raw(response.text)
36+
return UserResponse.model_validate_json(response.text)
3737

3838

3939
@final

server/apps/identity/logic/usecases/user_create_new.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import attr
44

5-
from server.apps.identity.intrastructure.services import placeholder
5+
from server.apps.identity.infrastructure.services import placeholder
66
from server.apps.identity.models import User
77
from server.common.django.types import Settings
88

server/apps/identity/logic/usecases/user_update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import attr
44

5-
from server.apps.identity.intrastructure.services import placeholder
5+
from server.apps.identity.infrastructure.services import placeholder
66
from server.apps.identity.models import User
77
from server.common.django.types import Settings
88

server/apps/identity/views/login.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
from ratelimit.mixins import RatelimitMixin
1111

1212
from server.apps.identity.container import container
13-
from server.apps.identity.intrastructure.django.decorators import (
13+
from server.apps.identity.infrastructure.django.decorators import (
1414
redirect_logged_in_users,
1515
)
16-
from server.apps.identity.intrastructure.django.forms import (
16+
from server.apps.identity.infrastructure.django.forms import (
1717
AuthenticationForm,
1818
RegistrationForm,
1919
)

server/apps/identity/views/user.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from ratelimit.mixins import RatelimitMixin
1111

1212
from server.apps.identity.container import container
13-
from server.apps.identity.intrastructure.django.forms import UserUpdateForm
13+
from server.apps.identity.infrastructure.django.forms import UserUpdateForm
1414
from server.apps.identity.logic.usecases.user_update import UserUpdate
1515
from server.apps.identity.models import User
1616
from server.common.django.decorators import dispatch_decorator
@@ -31,7 +31,7 @@ class UserUpdateView(RatelimitMixin, UpdateView[User, UserUpdateForm]):
3131
ratelimit_key = 'ip'
3232
ratelimit_rate = '10/h'
3333
ratelimit_block = True
34-
retelimit_method = ['POST', 'PUT'] # GET is safe
34+
ratelimit_method = ['POST', 'PUT'] # GET is safe
3535

3636
def get_object(self, queryset: QuerySet[User] | None = None) -> User:
3737
"""We only work with the current user."""

server/apps/pictures/logic/usecases/pictures_fetch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import attr
44

5-
from server.apps.pictures.intrastructure.services import placeholder
5+
from server.apps.pictures.infrastructure.services import placeholder
66
from server.common.django.types import Settings
77

88

server/apps/pictures/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ class FavouritePicture(TimedMixin, models.Model):
2222
url = models.URLField()
2323

2424
def __str__(self) -> str:
25-
"""Beatuful representation."""
25+
"""Beautiful representation."""
2626
return '<Picture {0} by {1}>'.format(self.foreign_id, self.user_id)

server/apps/pictures/views.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from django.views.generic import CreateView, ListView, TemplateView
99

1010
from server.apps.pictures.container import container
11-
from server.apps.pictures.intrastructure.django.forms import FavouritesForm
11+
from server.apps.pictures.infrastructure.django.forms import FavouritesForm
1212
from server.apps.pictures.logic.usecases import favourites_list, pictures_fetch
1313
from server.apps.pictures.models import FavouritePicture
1414
from server.common.django.decorators import dispatch_decorator
@@ -40,11 +40,11 @@ class DashboardView(CreateView[FavouritePicture, FavouritesForm]):
4040
success_url = reverse_lazy('pictures:dashboard')
4141

4242
def get_context_data(self, **kwargs: Any) -> dict[str, Any]:
43-
"""Innject extra context to template rendering."""
44-
fetch_puctures = container.instantiate(pictures_fetch.PicturesFetch)
43+
"""Inject extra context to template rendering."""
44+
fetch_pictures = container.instantiate(pictures_fetch.PicturesFetch)
4545

4646
context = super().get_context_data(**kwargs)
47-
context['pictures'] = fetch_puctures() # sync http call, may hang
47+
context['pictures'] = fetch_pictures() # sync http call, may hang
4848
return context
4949

5050
def get_form_kwargs(self) -> dict[str, Any]:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% if messages %}
22
{% for message in messages %}
3-
{# We don't have any non-succesful messages just yet #}
3+
{# We don't have any non-successful messages just yet #}
44
<p>{{ message }}</p>
55
{% endfor %}
66
{% endif %}

tests/test_server/test_urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from plugins.identity.user import ProfileAssertion, ProfileDataFactory
77

88

9-
@pytest.mark.django_db()()
9+
@pytest.mark.django_db()
1010
def test_health_check(client: Client) -> None:
1111
"""This test ensures that health check is accessible."""
1212
response = client.get('/health/')

0 commit comments

Comments
 (0)