def getPhoto request hozorgan allowedUsersList getUsersList request if

1
2
3
4
5
6
7
def getPhoto(request, hozorgan):
allowedUsersList = getUsersList(request)
if int(hozorgan) in allowedUsersList:
photo = Plist.objects.get(pk=int(hozorgan)).picture
else:
photo = ''
return HttpResponse(photo, mimetype="image/jpeg")