a few admin fixes

master
Alice 4 years ago
parent d47f75426e
commit 1dcf462376

@ -73,7 +73,7 @@ class GiftCodeUserAdmin(admin.TabularInline):
return format_html('<a href="{}">{}</a>', change_url, object.code.code) return format_html('<a href="{}">{}</a>', change_url, object.code.code)
code_link.short_description = 'Code' code_link.short_description = 'Code'
def has_add_permission(self, request): def has_add_permission(self, request, obj):
return False return False
def has_delete_permission(self, request, obj=None): def has_delete_permission(self, request, obj=None):

@ -250,8 +250,8 @@ def make_export_zip(user, name):
gw = django_lcore.api.get(gw_url) gw = django_lcore.api.get(gw_url)
gw_cache[gw_url] = { gw_cache[gw_url] = {
"name": gw["name"], "name": gw["name"],
"ipv4": gw["main_ipv4"], "ipv4": gw["main_addr"]["ipv4"],
"ipv6": gw["main_ipv6"], "ipv6": gw["main_addr"]["ipv6"],
} }
obj["gateway"] = gw_cache[gw_url] obj["gateway"] = gw_cache[gw_url]
return obj return obj

@ -1,5 +1,5 @@
{% extends "admin/base_site.html" %} {% extends "admin/base_site.html" %}
{% load i18n admin_static %} {% load i18n static %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />{% endblock %} {% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />{% endblock %}

@ -1,5 +1,5 @@
{% extends "admin/base_site.html" %} {% extends "admin/base_site.html" %}
{% load i18n admin_static %} {% load i18n static %}
{% block extrastyle %}{{ block.super }} {% block extrastyle %}{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" /> <link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />

Loading…
Cancel
Save