0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Update hooks.rst (#5044)

Document and Image fields changed from `uploaded_by` to `uploaded_by_user`
This commit is contained in:
ed@sharpertool.com 2019-01-30 13:43:34 -07:00 committed by Matt Westcott
parent f881420a98
commit f39f018ebf

View File

@ -705,7 +705,7 @@ Choosers
@hooks.register('construct_document_chooser_queryset')
def show_my_uploaded_documents_only(documents, request):
# Only show uploaded documents
documents = documents.filter(uploaded_by=request.user)
documents = documents.filter(uploaded_by_user=request.user)
return documents
@ -724,7 +724,7 @@ Choosers
@hooks.register('construct_image_chooser_queryset')
def show_my_uploaded_images_only(images, request):
# Only show uploaded images
images = images.filter(uploaded_by=request.user)
images = images.filter(uploaded_by_user=request.user)
return images