Remove obsolete is_valid() method

This commit is contained in:
Jeremy Stretch 2024-02-06 14:18:39 -05:00
parent 8e2e4979b0
commit f3ef004e04
2 changed files with 2 additions and 17 deletions

View File

@ -362,13 +362,6 @@ class BaseScript:
def source(self):
return inspect.getsource(self.__class__)
@property
def is_valid(self):
"""
Indicates whether the report can be run.
"""
return bool(self.test_methods)
@classmethod
def _get_vars(cls):
vars = {}

View File

@ -62,18 +62,10 @@
</td>
{% else %}
<td class="text-muted">{% trans "Never" %}</td>
<td>
{% if script.is_valid %}
{{ ''|placeholder }}
{% else %}
<span class="badge text-bg-danger" title="{% trans "Script has no methods" %}">
{% trans "Invalid" %}
</span>
{% endif %}
</td>
<td>{{ ''|placeholder }}</td>
{% endif %}
<td>
{% if perms.extras.run_script and script.is_valid %}
{% if perms.extras.run_script %}
<div class="float-end d-print-none">
<form action="{% url 'extras:script' module=script.module name=script.class_name %}" method="post">
{% csrf_token %}