stash
This commit is contained in:
parent
7c91661be2
commit
796fef81be
37 changed files with 3404 additions and 108 deletions
|
|
@ -1,5 +1,7 @@
|
|||
from django.http import HttpResponse
|
||||
from django.urls import path
|
||||
from django.db.models import Q
|
||||
from django.conf import settings
|
||||
from drf_yasg.utils import swagger_auto_schema
|
||||
from rest_framework import status
|
||||
from rest_framework.decorators import api_view, permission_classes, authentication_classes
|
||||
|
|
@ -7,7 +9,6 @@ from rest_framework.permissions import IsAuthenticated
|
|||
from rest_framework.response import Response
|
||||
|
||||
from authentication.signature_auth import SignatureAuthentication
|
||||
from backend import settings
|
||||
from files.models import File
|
||||
|
||||
|
||||
|
|
@ -17,7 +18,10 @@ from files.models import File
|
|||
@authentication_classes([SignatureAuthentication])
|
||||
def media_urls(request, hash_path):
|
||||
try:
|
||||
file = File.objects.filter(connected_items__owner__in=request.user.friends_or_self()).distinct().get(
|
||||
file = File.objects.filter(
|
||||
Q(connected_items__owner__in=request.user.friends_or_self()) |
|
||||
Q(profile_picture_users__in=request.user.friends_or_self())
|
||||
).distinct().get(
|
||||
file=hash_path)
|
||||
|
||||
if settings.SERVE_X_ACCEL_REDIRECT:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue