[mesMachines/main.py] Les clubs n'ont pas de droits

darcs-hash:20110307230127-ddb99-5faacf3e2ae77e2da1c556e4f596bc0c1d804e8b.gz
This commit is contained in:
Michel Blockelet 2011-03-08 00:01:27 +01:00
parent e9242a36af
commit 0339aea604

View file

@ -228,9 +228,9 @@ class main(ModuleBase):
def AJAXCreerMachine(self, nomNouvelleMachine, MACNouvelleMachine, typeNouvelleMachine):
adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid'])
est_personnel = adh.etudes(0) == 'Personnel ENS'
if est_personnel and typeNouvelleMachine == 'wifi':
if est_personnel and typeNouvelleMachine == 'wifi':
return {'error':'Vous n\'avez pas la possibilite d\'enregistrer de machine WiFi.'}
if typeNouvelleMachine=='fixe' and adh.droits() == [] and adh.machines_fixes() != [] and not est_personnel:
if typeNouvelleMachine=='fixe' and (isinstance(adh,Adherent) and adh.droits() == []) and adh.machines_fixes() != [] and not est_personnel:
return {'error':'Vous avez deja une machine fixe. Vous ne pouvez ajouter que des machines WiFi.'}
try:
if typeNouvelleMachine=='wifi':