Commit 3dd67924 authored by okhin's avatar okhin 🚴

Merge branch '16-fix-the-path-for-organization-logo' into 'master'

Resolve "Fix the path for organization logo"

Closes #16

See merge request !5
parents 92dee81b 194d5ebe
Pipeline #1132 passed with stage
in 44 seconds
from picampaign.organization.models import FeedbackCategory, Group, GroupType, Organization
from django.contrib.sites.shortcuts import get_current_site
from rest_framework import serializers
from picampaign.organization.models import FeedbackCategory, Group, GroupType, Organization
class CategorySerializer(serializers.ModelSerializer):
......@@ -24,6 +26,12 @@ class GroupTypeSerializer(serializers.ModelSerializer):
class OrganizationSerializer(serializers.ModelSerializer):
logo = serializers.SerializerMethodField()
class Meta:
model = Organization
fields = ('id', 'name', 'description', 'website', 'logo',)
def get_logo(self, obj):
if obj.logo:
return get_current_site + obj.logo.url
return None
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment