Replace getFromKeyName with getFromKeyNameOr404 where appropriate in soc.views.helper.access module.
Patch by: Pawel Solyga
Reviewed by: to-be-reviewed
--- a/app/soc/views/helper/access.py Mon Mar 09 10:58:04 2009 +0000
+++ b/app/soc/views/helper/access.py Mon Mar 09 16:34:54 2009 +0000
@@ -1081,7 +1081,7 @@
if not django_args.get('scope_path'):
raise out_of_band.AccessViolation(message_fmt=DEF_PAGE_DENIED_MSG)
- program_entity = program_logic.getFromKeyName(django_args['scope_path'])
+ program_entity = program_logic.getFromKeyNameOr404(django_args['scope_path'])
user_entity = user_logic.getForCurrentAccount()
filter = {'user': user_entity,
@@ -1137,7 +1137,7 @@
else:
key_name = django_args['scope_path']
- program_entity = program_logic.getFromKeyName(key_name)
+ program_entity = program_logic.getFromKeyNameOr404(key_name)
user_entity = user_logic.getForCurrentAccount()
filter = {'user': user_entity,
@@ -1168,7 +1168,7 @@
if not django_args.get('scope_path'):
raise out_of_band.AccessViolation(message_fmt=DEF_PAGE_DENIED_MSG)
- org_entity = org_logic.getFromKeyName(django_args['scope_path'])
+ org_entity = org_logic.getFromKeyNameOr404(django_args['scope_path'])
user_entity = user_logic.getForCurrentAccount()
filter = {'scope': org_entity.scope,
@@ -1400,7 +1400,7 @@
if key_name_field:
key_name = django_args[key_name_field]
- document = document_logic.getFromKeyName(key_name)
+ document = document_logic.getFromKeyNameOr404(key_name)
else:
document = document_logic.getFromKeyFieldsOr404(django_args)
@@ -1419,7 +1419,7 @@
if key_name_field:
key_name = django_args[key_name_field]
- document = document_logic.getFromKeyName(key_name)
+ document = document_logic.getFromKeyNameOr404(key_name)
else:
document = document_logic.getFromKeyFieldsOr404(django_args)