mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 08:36:32 +00:00
Merge pull request #102 from cthulahoops/shelf_button_user
Show shelf buttons appropriate for current user.
This commit is contained in:
commit
7be17ea09c
2 changed files with 4 additions and 2 deletions
|
@ -21,6 +21,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% include 'snippets/shelve_button.html' %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -84,7 +84,7 @@ def shelve_button_identifier(context, book):
|
||||||
''' check what shelf a user has a book on, if any '''
|
''' check what shelf a user has a book on, if any '''
|
||||||
try:
|
try:
|
||||||
shelf = models.ShelfBook.objects.get(
|
shelf = models.ShelfBook.objects.get(
|
||||||
shelf__user=context['user'],
|
shelf__user=context['request'].user,
|
||||||
book=book
|
book=book
|
||||||
)
|
)
|
||||||
except models.ShelfBook.DoesNotExist:
|
except models.ShelfBook.DoesNotExist:
|
||||||
|
@ -102,7 +102,7 @@ def shelve_button_text(context, book):
|
||||||
''' check what shelf a user has a book on, if any '''
|
''' check what shelf a user has a book on, if any '''
|
||||||
try:
|
try:
|
||||||
shelf = models.ShelfBook.objects.get(
|
shelf = models.ShelfBook.objects.get(
|
||||||
shelf__user=context['user'],
|
shelf__user=context['request'].user,
|
||||||
book=book
|
book=book
|
||||||
)
|
)
|
||||||
except models.ShelfBook.DoesNotExist:
|
except models.ShelfBook.DoesNotExist:
|
||||||
|
|
Loading…
Reference in a new issue