Skip to content

Commit

Permalink
Merge pull request #701 from Amsterdam/improve/118358-itinerary-perfo…
Browse files Browse the repository at this point in the history
…rmance

Improve/118358 itinerary performance
  • Loading branch information
remyvdwereld authored Aug 28, 2024
2 parents 546b2b6 + 04dfcd1 commit af7d9b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
- name: Create Docker Top and Zaak Backend Bridge network
run: docker network create top_and_zaak_backend_bridge
- name: Build Docker image
run: docker-compose -f docker-compose.local.yml up -d
run: docker compose -f docker-compose.local.yml up -d
- name: Run Tests
run: docker-compose -f docker-compose.local.yml exec -T api python manage.py test
run: docker compose -f docker-compose.local.yml exec -T api python manage.py test
5 changes: 1 addition & 4 deletions app/apps/itinerary/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,7 @@ def create(self, request):
case_id = case.get("id")
itinerary.add_case(case_id)

# Serialize the itinerary again
serializer = ItinerarySerializer(itinerary, context={"request": request})

return Response(serializer.data)
return Response("Itinerary created successfully")

def list(self, request):
date = self.__get_date_from_query_parameter__(request)
Expand Down
14 changes: 7 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Dankzij de TOP app hebben toezichthouders Wonen veel informatie over zaken, adre

## Build:
```bash
docker-compose -f docker-compose.local.yml build
docker compose -f docker-compose.local.yml build
```

## Creating networks
Expand All @@ -21,7 +21,7 @@ docker network create top_and_zaak_backend_bridge
## Starting the development server:
Start the dev server for local development:
```bash
docker-compose -f docker-compose.local.yml up
docker compose -f docker-compose.local.yml up
```

## Importing fixtures dump
Expand All @@ -30,13 +30,13 @@ The Django project needs some configuration in order to run locally. It's possib
Move the json into the `app` directory on the root of your project, and run the following command

```bash
docker-compose run --rm api python manage.py loaddata <name of fixture>
docker compose run --rm api python manage.py loaddata <name of fixture>
```
Remove the json fixture after installing it.

## Creating a superuser:
```bash
docker-compose run --rm api python manage.py createsuperuser
docker compose run --rm api python manage.py createsuperuser
```
A superuser can be used to access the Django backend

Expand Down Expand Up @@ -69,12 +69,12 @@ To fix this use threads instead by setting LOCAL_DEVELOPMENT_USE_MULTIPROCESSING
Run a command inside the docker container:

```bash
docker-compose run --rm api [command]
docker compose run --rm api [command]
```

Running migrations:
```bash
docker-compose run --rm api python manage.py migrate
docker compose run --rm api python manage.py migrate
```

## Adding pre-commit hooks
Expand All @@ -98,7 +98,7 @@ The project uses [Black](https://github.com/psf/black) for formatting and [Flake
## Running unit tests
Unit tests can be run using the following command:
```bash
docker-compose -f docker-compose.local.yml run --rm api python manage.py test
docker compose -f docker-compose.local.yml run --rm api python manage.py test

```

Expand Down

0 comments on commit af7d9b7

Please sign in to comment.