change member url to unique id
This commit is contained in:
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user