Skip to content

Commit

Permalink
[#1940] Fix organisation logo upload
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperBrandt committed Dec 3, 2015
1 parent f13f043 commit 79ca4f4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
13 changes: 1 addition & 12 deletions akvo/rest/views/project_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,6 @@ def project_editor_organisation_logo(request, pk=None):
return HttpResponseForbidden()

files = request.FILES
logo = None
errors, changes, rel_objects = [], [], {}

if 'logo' in files.keys():
Expand All @@ -661,14 +660,4 @@ def project_editor_organisation_logo(request, pk=None):
rel_objects, 'rsr_organisation.' + str(pk)
)

if not errors:
logo = get_thumbnail(
org.logo, '250x250', format="PNG", upscale=True
).url

return Response(
{
'errors': errors,
'logo': logo,
}
)
return Response({'errors': errors})
8 changes: 0 additions & 8 deletions akvo/rest/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,3 @@ class BaseRSRViewSet(viewsets.ModelViewSet):
permission_classes = (DjangoObjectPermissions, )
filter_backends = (filters.DjangoFilterBackend, filters.OrderingFilter, )
ordering_fields = '__all__'

def get_queryset(self):
"""Filter out any private projects."""
for related_obj in self.queryset.model._meta.get_all_related_objects():
if related_obj.model == Project:
self.queryset = self.queryset.filter(project__is_public=True)
break
return super(BaseRSRViewSet, self).get_queryset()

0 comments on commit 79ca4f4

Please sign in to comment.