[intranet/quota] on arrête de planter bêtement lorsque l'utilisateur n'a pas de quota
darcs-hash:20090624081109-bd074-2ea69a8121de6b3a830a7b578341bfbbae828901.gz
This commit is contained in:
parent
776af42937
commit
8968220f87
1 changed files with 16 additions and 14 deletions
|
@ -12,11 +12,14 @@ class main(ModuleBase):
|
|||
def title(self):
|
||||
return "Quotas"
|
||||
def icon(self):
|
||||
try:
|
||||
quotas = self._get_quota()
|
||||
for a_quota in quotas:
|
||||
if a_quota['quota'] < a_quota['usage']:
|
||||
return "icon_alert.png"
|
||||
return "icon.png"
|
||||
except:
|
||||
return "icon_disabled.png"
|
||||
|
||||
def _get_quota(self):
|
||||
if (cherrypy.config.configMap["global"]["server.environment"] == "development"):
|
||||
|
@ -25,7 +28,6 @@ class main(ModuleBase):
|
|||
return quota.getUserQuota(cherrypy.session['uid'])
|
||||
|
||||
|
||||
|
||||
##########################
|
||||
# affichage
|
||||
##########################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue