change member url to unique id

This commit is contained in:
2020-12-10 23:59:39 +00:00
parent 570e951189
commit 768f2fd2a9
5 changed files with 23 additions and 12 deletions

View File

@@ -64,11 +64,13 @@ def show(request, id=None):
elif id != "" and id is not None:
p = Post.objects.get(slug=(id))
post_author = Member.all_members.filter(nickname=p.author).first()
post_author = Member.all_members.filter(username=p.author).first()
author_image = None
author = None
if post_author:
author_image = post_author.image['avatar'].url
author = post_author
ep_agenda_link = "#"
ep_protocol_link = "#"
@@ -89,6 +91,7 @@ def show(request, id=None):
context = {
"post": p,
"author": author,
"author_image": author_image,
"next": get_next_dict(p),
"related_posts": p.tags.similar_objects()[:6],