mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Fixes a few missed calls to get_user_from_username
This commit is contained in:
parent
e6b4212e6b
commit
b9f06edc1b
4 changed files with 5 additions and 5 deletions
|
@ -91,7 +91,7 @@ class Status(View):
|
||||||
def get(self, request, username, status_id):
|
def get(self, request, username, status_id):
|
||||||
''' display a particular status (and replies, etc) '''
|
''' display a particular status (and replies, etc) '''
|
||||||
try:
|
try:
|
||||||
user = get_user_from_username(username)
|
user = get_user_from_username(request.user, username)
|
||||||
status = models.Status.objects.select_subclasses().get(
|
status = models.Status.objects.select_subclasses().get(
|
||||||
id=status_id, deleted=False)
|
id=status_id, deleted=False)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Goal(View):
|
||||||
''' track books for the year '''
|
''' track books for the year '''
|
||||||
def get(self, request, username, year):
|
def get(self, request, username, year):
|
||||||
''' reading goal page '''
|
''' reading goal page '''
|
||||||
user = get_user_from_username(username)
|
user = get_user_from_username(request.user, username)
|
||||||
year = int(year)
|
year = int(year)
|
||||||
goal = models.AnnualGoal.objects.filter(
|
goal = models.AnnualGoal.objects.filter(
|
||||||
year=year, user=user
|
year=year, user=user
|
||||||
|
@ -42,7 +42,7 @@ class Goal(View):
|
||||||
|
|
||||||
def post(self, request, username, year):
|
def post(self, request, username, year):
|
||||||
''' update or create an annual goal '''
|
''' update or create an annual goal '''
|
||||||
user = get_user_from_username(username)
|
user = get_user_from_username(request.user, username)
|
||||||
if user != request.user:
|
if user != request.user:
|
||||||
return HttpResponseNotFound()
|
return HttpResponseNotFound()
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ class UserLists(View):
|
||||||
page = int(request.GET.get('page', 1))
|
page = int(request.GET.get('page', 1))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
page = 1
|
page = 1
|
||||||
user = get_user_from_username(username)
|
user = get_user_from_username(request.user, username)
|
||||||
lists = models.List.objects.filter(user=user).all()
|
lists = models.List.objects.filter(user=user).all()
|
||||||
lists = privacy_filter(
|
lists = privacy_filter(
|
||||||
request.user, lists, ['public', 'followers', 'unlisted'])
|
request.user, lists, ['public', 'followers', 'unlisted'])
|
||||||
|
|
|
@ -11,7 +11,7 @@ class RssFeed(Feed):
|
||||||
|
|
||||||
def get_object(self, request, username):
|
def get_object(self, request, username):
|
||||||
''' the user who's posts get serialized '''
|
''' the user who's posts get serialized '''
|
||||||
return get_user_from_username(username)
|
return get_user_from_username(request.user, username)
|
||||||
|
|
||||||
|
|
||||||
def link(self, obj):
|
def link(self, obj):
|
||||||
|
|
Loading…
Reference in a new issue