Commit 34d38102 authored by Franco Velasco's avatar Franco Velasco

Fixed urls pointing to user

parent af702936
......@@ -29,9 +29,6 @@ class WidgetUser(models.Model):
def __str__(self):
return f"""{self.last_name}, {self.first_name} {self.middle_name}:
{self.id_num}, {self.email}, {self.department}"""
def get_absolute_url(self):
return f"users/{self.id_num}/details"
def get_name(self) -> str:
return f"{self.last_name}, {self.first_name} {self.middle_name}"
......
......@@ -22,7 +22,7 @@
<h3> {{ counter }}. {{ user.get_name }} </h3>
<div class="user-links">
<span> {{ user.id_num }} </span>
<a href="{{ user.get_absolute_url }}"> View Profile </a>
<a href="/users/{{ user.id_num }}/details"> View Profile </a>
</div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -3,7 +3,6 @@ from .views import HomePageView, UserPageView
urlpatterns = [
path('', HomePageView.as_view(), name='index'),
path('users/<int:user_id>/details', UserPageView.as_view(), name='user-details')
]
app_name = "Homepage"
\ No newline at end of file
......@@ -18,12 +18,14 @@ from django.urls import path, include
import Announcements.views as Announcements_views
import Forum.views as Forum_views
from Assignments.views import AssignmentDetailView
from Homepage.views import UserPageView
urlpatterns = [
path('admin/', admin.site.urls),
path('forum/', include('Forum.urls', namespace='Forum')),
path('posts/<int:post_id>/details/', Forum_views.details, name='post_details'),
path('homepage/', include('Homepage.urls', namespace="Homepage")),
path('users/<int:user_id>/details', UserPageView.as_view(), name='user-details'),
path('announcements/', include('Announcements.urls', namespace="Announcements")),
path('announcements/<int:announcement_id>/details', Announcements_views.details, name='announcement_details'),
path('assignments/', include('Assignments.urls', namespace="Assignments")),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment