Fixes a few missed calls to get_user_from_username

This commit is contained in:
Mouse Reeve 2021-02-23 13:12:50 -08:00
parent e6b4212e6b
commit b9f06edc1b
4 changed files with 5 additions and 5 deletions

View file

@ -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:

View file

@ -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()

View file

@ -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'])

View file

@ -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):