mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-21 15:32:14 +00:00
Added viewing user profiles
This commit is contained in:
@@ -249,4 +249,16 @@ class SecureAPIRequest(generic.View):
|
||||
json = simplejson.dumps(results[:20])
|
||||
return HttpResponse(json, content_type="application/json") # Always json
|
||||
|
||||
return HttpResponse(model)
|
||||
return HttpResponse(model)
|
||||
|
||||
class ProfileDetail(generic.DetailView):
|
||||
model = models.Profile
|
||||
|
||||
def get_queryset(self):
|
||||
try:
|
||||
pk = self.kwargs['pk']
|
||||
except KeyError:
|
||||
pk = self.request.user.id
|
||||
self.kwargs['pk'] = pk
|
||||
|
||||
return self.model.objects.filter(pk=pk)
|
||||
Reference in New Issue
Block a user