Bugfix de l'affichage de derniereConnexion
* timeformat ne connaissait pas les attributs lc_ldap * et il lui faut deux arguments
This commit is contained in:
parent
666bd33085
commit
58761db787
2 changed files with 6 additions and 2 deletions
|
@ -3,8 +3,8 @@
|
|||
{% if o.droits %}
|
||||
{{"Droits sur les serveurs : "|coul('gras')}}{{o.droits|join(', ')}}
|
||||
{% endif %}
|
||||
{{"Dernière connexion : "|coul('gras')}}{%if derniereConnexion %}
|
||||
{{o.derniereConnexion.0|timeformat}}
|
||||
{{"Dernière connexion : "|coul('gras')}}{%if o.derniereConnexion %}
|
||||
{{o.derniereConnexion.0|timeformat('%d/%m/%Y %H:%M:%S')}}
|
||||
{% else %}
|
||||
{{"Jamais"|coul('rouge')}}
|
||||
{% endif %}
|
||||
|
|
|
@ -13,6 +13,8 @@ import gestion.config as config
|
|||
import gestion
|
||||
import gestion.annuaires_pg
|
||||
|
||||
import lc_ldap.attributs as attributs
|
||||
|
||||
def try_import(lib):
|
||||
"""
|
||||
Cette fonction sert à faire de l'import soft : si l'import
|
||||
|
@ -43,6 +45,8 @@ def prise_etat(chbre):
|
|||
return gestion.whos.prise_etat(chbre)[0]
|
||||
|
||||
def timeformat(t, format):
|
||||
if isinstance(t, attributs.Attr):
|
||||
t = float(t.value)
|
||||
return time.strftime(format, time.localtime(t))
|
||||
|
||||
def blacklists(l):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue