Commit 4ff1344e authored by Pierre-Elliott Bécue's avatar Pierre-Elliott Bécue

[deconnexion.py] On arrondit à deux décimales.

parent c7a62df6
......@@ -15,7 +15,7 @@ To: %(to)s
Subject: %(proprio)s uploade
Content-Type: text/plain; charset="utf-8"
%(proprio)s uploade actuellement %(upload)s Mo.
%(proprio)s uploade actuellement %(upload)s Mio.
--\u0020
Message créé par deconnexion.py"""
......@@ -23,7 +23,7 @@ Message créé par deconnexion.py"""
class Message_disconnect_hard(Message):
"""Envoyé à la ML disconnect@ en cas de dépassement de la limite hard"""
template = u"""%(proprio)s (%(id)s) a été limité en débit montant du fait d'un
upload excessif (%(upload)s Mo).
upload excessif (%(upload)s Mio).
Ses machines ont été aperçues pour la dernière fois à ces endroits :
%(mdc)s
......
......@@ -218,7 +218,7 @@ for elupload, eltype, elid in uploadeurs:
################################
mail = connectsmtp()
corps = mail_module.generate('upload_hard', {'from': upload.expediteur, 'to': proprio.email(), 'upload': elupload, 'proprio': proprio.Nom(), 'lang_info':'English version below'}).as_string()
corps = mail_module.generate('upload_hard', {'from': upload.expediteur, 'to': proprio.email(), 'upload': "%.2f" % (elupload,), 'proprio': proprio.Nom(), 'lang_info':'English version below'}).as_string()
mail.sendmail(upload.expediteur, proprio.email(), corps)
# On envoie un mail à disconnect
......@@ -228,7 +228,7 @@ for elupload, eltype, elid in uploadeurs:
theid = "cid="
else:
theid = "aid="
mail_disconnect_hard = config.mails.upload.Message_disconnect_hard(upload.expediteur, upload.expediteur, proprio=proprio.Nom(), id=theid + proprio.id(), upload=elupload, mdc=mdcf, chambre=proprio.chbre())
mail_disconnect_hard = config.mails.upload.Message_disconnect_hard(upload.expediteur, upload.expediteur, proprio=proprio.Nom(), id=theid + proprio.id(), upload="%.2f" % (elupload,), mdc=mdcf, chambre=proprio.chbre())
mail_disconnect_hard.send()
# Vérification du nombre de déconnexions
......@@ -276,13 +276,13 @@ for elupload, eltype, elid in uploadeurs:
################################
mail = connectsmtp()
corps = mail_module.generate('upload_soft', {'from': upload.expediteur, 'to': proprio.email(), 'upload': elupload, 'proprio': proprio.Nom(), 'lang_info':'English version below'}).as_string()
corps = mail_module.generate('upload_soft', {'from': upload.expediteur, 'to': proprio.email(), 'upload': "%.2f" % (elupload,), 'proprio': proprio.Nom(), 'lang_info':'English version below'}).as_string()
mail.sendmail(upload.expediteur, proprio.email(), corps)
# On envoie un mail à disconnect
################################
if upload.disconnect_mail_soft:
corps = config.mails.upload.message_disconnect_soft % {'from': upload.expediteur, 'to': upload.expediteur, 'upload': elupload, 'proprio': proprio.Nom()}
corps = config.mails.upload.message_disconnect_soft % {'from': upload.expediteur, 'to': upload.expediteur, 'upload': "%.2f" % (elupload,), 'proprio': proprio.Nom()}
corps = corps.encode('utf-8')
mail.sendmail(upload.expediteur, upload.expediteur, corps)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment