mirror of https://github.com/jumpserver/jumpserver
parent
d415e81add
commit
6aaa106aff
|
@ -218,8 +218,8 @@ class AdHoc(models.Model):
|
|||
history.result = raw
|
||||
history.summary = summary
|
||||
return raw, summary
|
||||
except:
|
||||
return {}, {}
|
||||
except Exception as e:
|
||||
return {}, {"dark": {"all": str(e)}, "contacted": []}
|
||||
finally:
|
||||
history.date_finished = timezone.now()
|
||||
history.timedelta = time.time() - time_start
|
||||
|
|
|
@ -43,8 +43,8 @@ class AdHocRunHistorySerializer(serializers.ModelSerializer):
|
|||
def get_stat(obj):
|
||||
return {
|
||||
"total": len(obj.adhoc.hosts),
|
||||
"success": len(obj.summary["contacted"]),
|
||||
"failed": len(obj.summary["dark"]),
|
||||
"success": len(obj.summary.get("contacted", [])),
|
||||
"failed": len(obj.summary.get("dark", [])),
|
||||
}
|
||||
|
||||
def get_field_names(self, declared_fields, info):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% load i18n %}
|
||||
{% block first_login_message %}
|
||||
{% if user.is_authenticated and user.is_first_login %}
|
||||
{% if request.user.is_authenticated and request.user.is_first_login %}
|
||||
<div class="alert alert-danger help-message">
|
||||
{% url 'users:user-first-login' as first_login_url %}
|
||||
{% blocktrans %}
|
||||
|
@ -10,7 +10,7 @@
|
|||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block update_public_key_message %}
|
||||
{% if user.is_authenticated and not user.is_public_key_valid %}
|
||||
{% if request.user.is_authenticated and not request.user.is_public_key_valid %}
|
||||
<div class="alert alert-danger help-message">
|
||||
{% url 'users:user-pubkey-update' as user_pubkey_update %}
|
||||
{% blocktrans %}
|
||||
|
|
Loading…
Reference in New Issue