FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 50ce1a9f authored by Dr Abraham Martin's avatar Dr Abraham Martin
Browse files

Return empty LookupGroup list if IbisException

parent c5b5e16a
No related branches found
Tags 1.6.1
No related merge requests found
django-ucamlookup changelog django-ucamlookup changelog
============================= =============================
1.6.1 - 09/10/2015
------------------
- Return empty LookupGroup list if IbisException
1.6 - 09/10/2015 1.6 - 09/10/2015
------------------ ------------------
......
django-ucamlookup (1.6.1) unstable; urgency=high
* Return empty LookupGroup list if IbisException
-- Abraham Martin <amc203@cam.ac.uk> Fri, 9 Oct 2015 11:58:39 +0100
django-ucamlookup (1.6) unstable; urgency=high django-ucamlookup (1.6) unstable; urgency=high
* Dropped support for django 1.6 (no longer supported by django project) * Dropped support for django 1.6 (no longer supported by django project)
......
...@@ -5,12 +5,12 @@ Uploaders: Abraham Martin <amc203@cam.ac.uk>, ...@@ -5,12 +5,12 @@ Uploaders: Abraham Martin <amc203@cam.ac.uk>,
Section: python Section: python
Priority: optional Priority: optional
Build-Depends: python-setuptools, python-all (>= 2.6.6-3), debhelper (>=9), Build-Depends: python-setuptools, python-all (>= 2.6.6-3), debhelper (>=9),
python-django (>=1.6), python-markdown, dh-python python-django (>=1.7), python-markdown, dh-python
Standards-Version: 3.9.4 Standards-Version: 3.9.4
Package: python-django-ucamlookup Package: python-django-ucamlookup
Architecture: all Architecture: all
Depends: python-django (>=1.6), python-requests, python-openssl, ${misc:Depends}, ${python:Depends} Depends: python-django (>=1.7), python-requests, python-openssl, ${misc:Depends}, ${python:Depends}
Description: University of Cambridge Web Authentication module for Django Description: University of Cambridge Web Authentication module for Django
This package provides a django authentication back-end to the This package provides a django authentication back-end to the
University of Cambridge Web Authentication system. University of Cambridge Web Authentication system.
...@@ -8,7 +8,7 @@ setup( ...@@ -8,7 +8,7 @@ setup(
description='A Django module for the University of Cambridge Lookup service', description='A Django module for the University of Cambridge Lookup service',
long_description=open('README.rst').read(), long_description=open('README.rst').read(),
url='https://git.csx.cam.ac.uk/x/ucs/u/amc203/django-ucamlookup.git', url='https://git.csx.cam.ac.uk/x/ucs/u/amc203/django-ucamlookup.git',
version='1.6', version='1.6.1',
license='MIT', license='MIT',
author='Information Systems Group, University Information Services, University of Cambridge', author='Information Systems Group, University Information Services, University of Cambridge',
author_email='information-systems@ucs.cam.ac.uk', author_email='information-systems@ucs.cam.ac.uk',
......
...@@ -46,9 +46,11 @@ def get_group_ids_of_a_user_in_lookup(user): ...@@ -46,9 +46,11 @@ def get_group_ids_of_a_user_in_lookup(user):
:param user: the user :param user: the user
:return: the list of group_ids :return: the list of group_ids
""" """
try:
group_list = PersonMethods(conn).getGroups(scheme="crsid", identifier=user.username) group_list = PersonMethods(conn).getGroups(scheme="crsid", identifier=user.username)
return map(lambda group: group.groupid, group_list) return map(lambda group: group.groupid, group_list)
except IbisException:
return []
def get_or_create_group_by_groupid(groupid): def get_or_create_group_by_groupid(groupid):
...@@ -69,8 +71,11 @@ def get_user_lookupgroups(user): ...@@ -69,8 +71,11 @@ def get_user_lookupgroups(user):
:param user: the User :param user: the User
:return: the list of LookupGroups :return: the list of LookupGroups
""" """
group_list = PersonMethods(conn).getGroups(scheme="crsid", identifier=user.username) try:
return map(lambda group: get_or_create_group_by_groupid(group.groupid), group_list) group_list = PersonMethods(conn).getGroups(scheme="crsid", identifier=user.username)
return map(lambda group: get_or_create_group_by_groupid(group.groupid), group_list)
except IbisException:
return []
def get_institutions(user=None): def get_institutions(user=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment