fix bug introduced in selflink code
diff --git a/xos/core/admin.py b/xos/core/admin.py
index e2a7adc..a83ec7d 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -310,7 +310,7 @@
def get_change_url(self, id):
""" Get the URL to a change form in the admin for this model """
- reverse_path = self.selflink_reverse_path # "admin:%s_change" % (model._meta.db_table)
+ reverse_path = self.selflink_reverse_path # "admin:%s_change" % (self.selflink_model._meta.db_table)
try:
url = reverse(reverse_path, args=(id,))
except NoReverseMatch:
diff --git a/xos/hpc/filteredadmin.py b/xos/hpc/filteredadmin.py
index d21cc00..4ef3fe3 100644
--- a/xos/hpc/filteredadmin.py
+++ b/xos/hpc/filteredadmin.py
@@ -170,20 +170,20 @@
return FilteredChangeList
class FilteredInline(XOSTabularInline):
- def get_change_url(self, model, id):
+ def get_change_url(self, id):
request = get_request()
embedded = getattr(request, "embedded", False)
service_id = request.resolver_match.args[0]
if embedded:
- reverse_path = "admin:%s_embeddedfilteredchange" % (model._meta.db_table)
+ reverse_path = "admin:%s_embeddedfilteredchange" % (self.selflink_model._meta.db_table)
args = (service_id, id)
else:
- reverse_path = "admin:%s_filteredchange" % (model._meta.db_table)
+ reverse_path = "admin:%s_filteredchange" % (self.selflink_model._meta.db_table)
args = (service_id, id)
try:
- url = reverse(reverse_path, args=args, current_app=model._meta.app_label)
+ url = reverse(reverse_path, args=args, current_app=self.selflink_model._meta.app_label)
except NoReverseMatch:
return None