diff --git a/music/templates/music/delete_album_review.html b/music/templates/music/delete_album_review.html
index 99936ba5..f804b1a6 100644
--- a/music/templates/music/delete_album_review.html
+++ b/music/templates/music/delete_album_review.html
@@ -46,7 +46,7 @@
-
{{ review.owner.username }}
{% if mark %}
diff --git a/music/templates/music/delete_song.html b/music/templates/music/delete_song.html
index f398d797..443c1b97 100644
--- a/music/templates/music/delete_song.html
+++ b/music/templates/music/delete_song.html
@@ -55,7 +55,7 @@
{% if song.last_editor %}
diff --git a/music/templates/music/delete_song_review.html b/music/templates/music/delete_song_review.html
index 96f14481..1f66154c 100644
--- a/music/templates/music/delete_song_review.html
+++ b/music/templates/music/delete_song_review.html
@@ -46,7 +46,7 @@
-
{{ review.owner.username }}
{% if mark %}
diff --git a/music/templates/music/song_detail.html b/music/templates/music/song_detail.html
index 8dfa5fae..55c9df8c 100644
--- a/music/templates/music/song_detail.html
+++ b/music/templates/music/song_detail.html
@@ -118,7 +118,7 @@
{% if song.last_editor %}
-
+
{% endif %}
@@ -170,7 +170,7 @@
{% for others_mark in mark_list %}
-
- {{ others_mark.owner.username }}
+ {{ others_mark.owner.username }}
{{ others_mark.get_status_display }}
{% if others_mark.rating %}
@@ -199,7 +199,7 @@
{% for others_review in review_list %}
-
- {{ others_review.owner.username }}
+ {{ others_review.owner.username }}
{% if others_review.visibility > 0 %}
{% endif %}
diff --git a/music/templates/music/song_mark_list.html b/music/templates/music/song_mark_list.html
index f51712be..3096d384 100644
--- a/music/templates/music/song_mark_list.html
+++ b/music/templates/music/song_mark_list.html
@@ -40,7 +40,7 @@
{% for mark in marks %}
-
- {{ mark.owner.username }}
{{ mark.get_status_display }}
{% if mark.rating %}
diff --git a/music/templates/music/song_review_detail.html b/music/templates/music/song_review_detail.html
index a052dc87..d099b4e0 100644
--- a/music/templates/music/song_review_detail.html
+++ b/music/templates/music/song_review_detail.html
@@ -48,7 +48,7 @@
-
{{ review.owner.username }}
+
{{ review.owner.username }}
{% if mark %}
diff --git a/music/templates/music/song_review_list.html b/music/templates/music/song_review_list.html
index b0ec4cf8..87f8e0e3 100644
--- a/music/templates/music/song_review_list.html
+++ b/music/templates/music/song_review_list.html
@@ -40,7 +40,7 @@
-
- {{ review.owner.username }}
+ {{ review.owner.username }}
{% if review.visibility > 0 %}
{% endif %}
diff --git a/users/templates/users/home.html b/users/templates/users/home.html
index f89bc3a4..f7e430f4 100644
--- a/users/templates/users/home.html
+++ b/users/templates/users/home.html
@@ -873,9 +873,9 @@
{% for report in reports %}
-
- {{ report.submit_user }}{% trans '举报了' %}{{ report.reported_user }}
{% empty %}
diff --git a/users/templates/users/manage_report.html b/users/templates/users/manage_report.html
index 567cf367..42385f79 100644
--- a/users/templates/users/manage_report.html
+++ b/users/templates/users/manage_report.html
@@ -27,9 +27,9 @@
{% for report in reports %}
-
{{ report.submit_user.username }}
+
{{ report.submit_user.username }}
{% trans '举报了' %}
-
{{ report.reported_user.username }}
+
{{ report.reported_user.username }}
@{{ report.submitted_time }}
{% if report.image %}
diff --git a/users/urls.py b/users/urls.py
index eeb8cd06..bc49e374 100644
--- a/users/urls.py
+++ b/users/urls.py
@@ -18,14 +18,14 @@ urlpatterns = [
path('delete/', delete, name='delete'),
path('layout/', set_layout, name='set_layout'),
path('OAuth2_login/', OAuth2_login, name='OAuth2_login'),
- path('
/', home, name='home'),
- path('/followers/', followers, name='followers'),
- path('/following/', following, name='following'),
- path('/collections/', collection_list, name='collection_list'),
- path('/book//', book_list, name='book_list'),
- path('/movie//', movie_list, name='movie_list'),
- path('/music//', music_list, name='music_list'),
- path('/game//', game_list, name='game_list'),
+ path('/', home_redirect, name='home_redirect'),
+ # path('/followers/', followers, name='followers'),
+ # path('/following/', following, name='following'),
+ # path('/collections/', collection_list, name='collection_list'),
+ # path('/book//', book_list, name='book_list'),
+ # path('/movie//', movie_list, name='movie_list'),
+ # path('/music//', music_list, name='music_list'),
+ # path('/game//', game_list, name='game_list'),
path('/', home, name='home'),
path('/followers/', followers, name='followers'),
path('/following/', following, name='following'),
diff --git a/users/views.py b/users/views.py
index 7ee1e44e..6c5ba15c 100644
--- a/users/views.py
+++ b/users/views.py
@@ -228,6 +228,15 @@ def delete(request):
raise NotImplementedError
+def home_redirect(request, id):
+ try:
+ query_kwargs = {'pk': id}
+ user = User.objects.get(**query_kwargs)
+ return redirect(reverse("users:home", args=[user.mastodon_username]))
+ except Exception:
+ return redirect(settings.LOGIN_URL)
+
+
def home_anonymous(request, id):
login_url = settings.LOGIN_URL + "?next=" + request.get_full_path()
try:
@@ -950,7 +959,7 @@ def report(request):
form.instance.is_read = False
form.instance.submit_user = request.user
form.save()
- return redirect(reverse("users:home", args=[form.instance.reported_user.id]))
+ return redirect(reverse("users:home", args=[form.instance.reported_user.mastodon_username]))
else:
return render(
request,