You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a package is moved from, lets say extra to community, if it is present in a TODO list, the package link is not updated there. This results in the TODO list linking to https://www.archlinux.org/packages/extra/x86_64/package/ instead of https://www.archlinux.org/packages/community/x86_64/package/.
The text was updated successfully, but these errors were encountered:
FFY00
changed the title
Links TODO lists are not updated when a package is moved between repositories
Links in TODO lists are not updated when a package is moved between repositories
Mar 23, 2019
I might be mistaken, but it looks like the TodolistPackage model is not normalized, it contains redundancy:
The repo, pkgname and pkgbase attributes of TodolistPackage are copies of the corresponding TodolistPackage::pkg model's attributes. I guess these fields are there to make queries faster/easier, but they can go out of sync this way.
I've found other models that might have such problematic attributes, I've added them to the diagram.
I think a quick fix for the issue would be the following, but the root cause I mentioned could cause additional bugs (in case I'm not wrong about the normalization).
diff --git a/todolists/templatetags/todolists.py b/todolists/templatetags/todolists.py
index a54a9b8..b209228 100644
--- a/todolists/templatetags/todolists.py+++ b/todolists/templatetags/todolists.py@@ -14,7 +14,7 @@ def todopkg_details_link(todopkg):
if not pkg:
return todopkg.pkgname
link = '<a href="%s" title="View package details for %s">%s</a>'
- url = pkg_absolute_url(todopkg.repo, todopkg.arch, pkg.pkgname)+ url = pkg_absolute_url(pkg.repo, pkg.arch, pkg.pkgname)
return format_html(link % (url, pkg.pkgname, pkg.pkgname))
When a package is moved from, lets say
extra
tocommunity
, if it is present in a TODO list, the package link is not updated there. This results in the TODO list linking tohttps://www.archlinux.org/packages/extra/x86_64/package/
instead ofhttps://www.archlinux.org/packages/community/x86_64/package/
.The text was updated successfully, but these errors were encountered: