Fix display format on SaaS & Sever admin list
mark_safe generated HTML
This commit is contained in:
parent
a6c5aa32df
commit
3b4bb51925
|
@ -179,12 +179,12 @@ class ServerAdmin(ExtendedModelAdmin):
|
|||
change_view_actions = actions
|
||||
|
||||
def display_ping(self, instance):
|
||||
return self._remote_state[instance.pk][0]
|
||||
return mark_safe(self._remote_state[instance.pk][0])
|
||||
display_ping.short_description = _("Ping")
|
||||
display_ping.allow_tags = True
|
||||
|
||||
def display_uptime(self, instance):
|
||||
return self._remote_state[instance.pk][1]
|
||||
return mark_safe(self._remote_state[instance.pk][1])
|
||||
display_uptime.short_description = _("Uptime")
|
||||
display_uptime.allow_tags = True
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django.contrib import admin
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from orchestra.admin import ExtendedModelAdmin, ChangePasswordAdminMixin
|
||||
|
@ -27,6 +28,7 @@ class SaaSAdmin(SelectPluginAdminMixin, ChangePasswordAdminMixin, AccountAdminMi
|
|||
plugin_title = 'Software as a Service'
|
||||
actions = (disable, enable, list_accounts)
|
||||
|
||||
@mark_safe
|
||||
def display_url(self, saas):
|
||||
site_domain = saas.get_site_domain()
|
||||
site_link = '<a href="http://%s">%s</a>' % (site_domain, site_domain)
|
||||
|
|
Loading…
Reference in New Issue