Skip to content

Commit

Permalink
get_absolute_url bug fix, writing authentication bug fix in board list
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebamus committed Jul 3, 2023
1 parent 140d1c2 commit 4107384
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
9 changes: 5 additions & 4 deletions blog/models/blog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import re

from bs4 import BeautifulSoup as Bs

# from django.db.models.constraints import UniqueConstraint
from django.conf import settings
from django.db import models
Expand Down Expand Up @@ -164,7 +165,7 @@ class Meta:
ordering = ["-created_at"]

def get_absolute_url(self):
return reverse("blog:opensource_detail", kwargs={"pk": self.pk})
return reverse("blog:project_detail", kwargs={"pk": self.pk})


class OnlineStudyPost(Post):
Expand Down Expand Up @@ -198,7 +199,7 @@ class Meta:
ordering = ["-created_at"]

def get_absolute_url(self):
return reverse("blog:opensource_detail", kwargs={"pk": self.pk})
return reverse("blog:online_study_detail", kwargs={"pk": self.pk})


class BlogPost(Post):
Expand All @@ -217,7 +218,7 @@ class Meta:
ordering = ["-created_at"]

def get_absolute_url(self):
return reverse("blog:opensource_detail", kwargs={"pk": self.pk})
return reverse("blog:blog_detail", kwargs={"pk": self.pk})


class OpenSourcePost(Post):
Expand Down Expand Up @@ -292,7 +293,7 @@ class Meta:
ordering = ["-created_at"]

def get_absolute_url(self):
return reverse("blog:opensource_detail", kwargs={"pk": self.pk})
return reverse("blog:books_detail", kwargs={"pk": self.pk})


class Tag(models.Model):
Expand Down
5 changes: 2 additions & 3 deletions board/models/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class Meta:
ordering = ["-created_at"]

def get_absolute_url(self):
print("Notice !!!! ")
return reverse("board:notice_detail", kwargs={"pk": self.pk})


Expand All @@ -100,7 +99,7 @@ class Meta:
ordering = ["-created_at"]

def get_absolute_url(self):
return reverse("board:notice_detail", kwargs={"pk": self.pk})
return reverse("board:visiter_detail", kwargs={"pk": self.pk})


class Reactivation(Board):
Expand All @@ -112,4 +111,4 @@ class Meta:
ordering = ["-created_at"]

def get_absolute_url(self):
return reverse("board:notice_detail", kwargs={"pk": self.pk})
return reverse("board:reactivation_detail", kwargs={"pk": self.pk})
2 changes: 1 addition & 1 deletion templates/board/board_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2 class="title">board title </h2>
{% endfor %}

</table>
{% if request.user.is_staff %}
{% if user.is_authenticated and "visiter" in request.path %}
<div class="board-button mt-4">
<div class="row">
<div class="col-12">
Expand Down
3 changes: 0 additions & 3 deletions users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@ def get_full_name(self):

get_full_name.short_description = _("Full name")

def get_absolute_url(self):
return reverse("") # profile page

def set_dormant_account(self):
# self.instance
# send email
Expand Down

0 comments on commit 4107384

Please sign in to comment.