[#4] Fix typo in auth functions

This commit is contained in:
amercader 2013-01-16 12:56:58 +00:00
parent 2f4cd3a4b0
commit 2ab10afcf9
4 changed files with 5 additions and 6 deletions

View File

@ -14,7 +14,7 @@ def harvest_source_create(context, data_dict):
try:
pt.check_access('package_create', context, data_dict)
return {'success': True}
except pt.Not_Authorized:
except pt.NotAuthorized:
return {'success': False,
'msg': pt._('User {0} not authorized to create harvest sources').format(user)}
@ -34,11 +34,10 @@ def harvest_job_create(context, data_dict):
raise pt.ObjectNotFound(pt._('Harvest source not found'))
context['package'] = pkg
try:
pt.check_access('package_update', context, data_dict)
return {'success': True}
except pt.Not_Authorized:
except pt.NotAuthorized:
return {'success': False,
'msg': pt._('User not authorized to create a job for source {0}').format(source_id)}

View File

@ -22,6 +22,6 @@ def harvest_source_update(context, data_dict):
try:
pt.check_access('package_delete', context, data_dict)
return {'success': True}
except pt.Not_Authorized:
except pt.NotAuthorized:
return {'success': False,
'msg': pt._('User {0} not authorized to delete harvest source {1}').format(user, source_id)}

View File

@ -23,7 +23,7 @@ def harvest_source_show(context, data_dict):
try:
pt.check_access('package_show', context, data_dict)
return {'success': True}
except pt.Not_Authorized:
except pt.NotAuthorized:
return {'success': False,
'msg': pt._('User {0} not authorized to read harvest source {1}').format(user, source_id)}

View File

@ -23,7 +23,7 @@ def harvest_source_update(context, data_dict):
try:
pt.check_access('package_update', context, data_dict)
return {'success': True}
except pt.Not_Authorized:
except pt.NotAuthorized:
return {'success': False,
'msg': pt._('User {0} not authorized to update harvest source {1}').format(user, source_id)}