Improve error message

This commit is contained in:
Cédric Krier committed 2008-02-01 18:59:07 +01:00
1 parent b4eb16e9d6
commit 22f0570f2b
1 file changed
+15 -10
+15 -10
View File
@@ -105,19 +105,24 @@ class ModelAccess(OSV):
if not row[0][0]:
if raise_exception:
if mode == 'read':
raise except_orm('AccessError',
'You can not read this document!')
raise ExceptORM('AccessError',
'You can not read this document! (%s)' \
% model_name)
elif mode == 'write':
raise except_orm('AccessError',
'You can not write in this document!')
raise ExceptORM('AccessError',
'You can not write in this document! (%s)' \
% model_name)
elif mode == 'create':
raise except_orm('AccessError',
'You can not create this kind of document!')
raise ExceptORM('AccessError',
'You can not create this kind of document! (%s)' \
% model_name)
elif mode == 'unlink':
raise except_orm('AccessError',
'You can not delete this document!')
raise except_orm('AccessError',
'You do not have access to this document!')
raise ExceptORM('AccessError',
'You can not delete this document! (%s)' \
% model_name)
raise ExceptORM('AccessError',
'You do not have access to this document! (%s)' \
% model_name)
else:
return False
return True