1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-19 04:49:37 +02:00

Fix adventure cards and serializers

This commit is contained in:
Sean Morley 2024-08-13 11:09:49 -04:00
parent 5aef1eb8bd
commit ffe9d6fe97
4 changed files with 7 additions and 7 deletions

View file

@ -13,7 +13,7 @@ class AdventureSerializer(serializers.ModelSerializer):
representation = super().to_representation(instance) representation = super().to_representation(instance)
if instance.image: if instance.image:
public_url = os.environ.get('PUBLIC_URL', 'http://127.0.0.1:8000').rstrip('/') public_url = os.environ.get('PUBLIC_URL', 'http://127.0.0.1:8000').rstrip('/')
print(public_url) #print(public_url)
# remove any ' from the url # remove any ' from the url
public_url = public_url.replace("'", "") public_url = public_url.replace("'", "")
representation['image'] = f"{public_url}/media/{instance.image.name}" representation['image'] = f"{public_url}/media/{instance.image.name}"

View file

@ -174,7 +174,7 @@ class CustomUserDetailsSerializer(UserDetailsSerializer):
representation = super().to_representation(instance) representation = super().to_representation(instance)
if instance.profile_pic: if instance.profile_pic:
public_url = os.environ.get('PUBLIC_URL', 'http://127.0.0.1:8000').rstrip('/') public_url = os.environ.get('PUBLIC_URL', 'http://127.0.0.1:8000').rstrip('/')
print(public_url) #print(public_url)
# remove any ' from the url # remove any ' from the url
public_url = public_url.replace("'", "") public_url = public_url.replace("'", "")
representation['profile_pic'] = f"{public_url}/media/{instance.profile_pic.name}" representation['profile_pic'] = f"{public_url}/media/{instance.profile_pic.name}"

View file

@ -2,8 +2,8 @@ version: "3.9"
services: services:
web: web:
#build: ./frontend/ build: ./frontend/
image: ghcr.io/seanmorley15/adventurelog-frontend:latest #image: ghcr.io/seanmorley15/adventurelog-frontend:latest
environment: environment:
- PUBLIC_SERVER_URL=http://server:8000 - PUBLIC_SERVER_URL=http://server:8000
- ORIGIN=http://localhost:8080 - ORIGIN=http://localhost:8080
@ -23,8 +23,8 @@ services:
- postgres_data:/var/lib/postgresql/data/ - postgres_data:/var/lib/postgresql/data/
server: server:
#build: ./backend/ build: ./backend/
image: ghcr.io/seanmorley15/adventurelog-backend:latest #image: ghcr.io/seanmorley15/adventurelog-backend:latest
environment: environment:
- PGHOST=db - PGHOST=db
- PGDATABASE=database - PGDATABASE=database

View file

@ -156,7 +156,7 @@
<div class="flex justify-between"> <div class="flex justify-between">
<button <button
on:click={() => goto(`/adventures/${adventure.id}`)} on:click={() => goto(`/adventures/${adventure.id}`)}
class="text-2xl font-semibold -mt-2 break-words text-wrap hover:underline" class="text-2xl font-semibold -mt-2 break-words text-wrap hover:underline text-left"
> >
{adventure.name} {adventure.name}
</button> </button>