-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The attached patch resolves the following issues that were interfering with FAS integration in ReviewBoard. django/auth/middleware.py: If there are other authentication mechanisms in place, don't throw an exception on a missing session_id django/auth/models.py: connection.group_list returns a tuple, the second entry of which is the dict that we intended to be accessing. Trying to call gl['groups'] throws a KeyError userinfo in _get_name() contains a double-level dictionary. When requesting 'human_name', we need to access the 'person' dictionary first or we throw a KeyError - -- Stephen Gallagher RHCE 804006346421761 Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iEYEARECAAYFAkt63FwACgkQeiVVYja6o6MO5wCbBxWmJ7bVn6FxzGuBOta+4IMI TdYAn20akaNKqn2ibHU2Oy6n17BKOR+Q =A2UF -----END PGP SIGNATURE-----
# Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: sgallagh@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # target_branch: bzr://bzr.fedorahosted.org/bzr/python-fedora/python-\ # fedora-devel/ # testament_sha1: c9e3af7506ac04bedbee51287e2db727deeebc66 # timestamp: 2010-02-16 12:55:16 -0500 # base_revision_id: toshio@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\ # q69f2pcejl403upz # # Begin patch === modified file 'fedora/django/auth/middleware.py' --- fedora/django/auth/middleware.py 2009-07-30 21:18:38 +0000 +++ fedora/django/auth/middleware.py 2010-02-16 15:51:10 +0000 @@ -44,7 +44,10 @@ if 'tg-visit' in request.session: del request.session['tg-visit'] else: - request.session['tg-visit'] = local.session_id + try: + request.session['tg-visit'] = local.session_id + except: + pass # response.set_cookie(key='tg-visit', # value=local.session_id, max_age=0) return response === modified file 'fedora/django/auth/models.py' --- fedora/django/auth/models.py 2009-12-23 14:23:12 +0000 +++ fedora/django/auth/models.py 2010-02-16 15:51:10 +0000 @@ -56,7 +56,7 @@ print _('Unable to load FAS groups. Did you set ' 'FAS_USERNAME and FAS_PASSWORD?') else: - groups = gl['groups'] + groups = gl[1]['groups'] for group in groups: _new_group(group) if verbosity > 0: @@ -91,7 +91,11 @@ class FasUser(authmodels.User): def _get_name(self): userinfo = person_by_id(self.id) - return userinfo['human_name'] + human_name = userinfo['person']['human_name'] + if human_name: + return human_name + else: + return '' def _get_email(self): return '%s@xxxxxxxxxxxxxxxxx' % self.username # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWWL/uH4AAnj/gERUQABR5/// U6gcir////BQBc9zte5wo0NdvcUz2usdwlEgNJlNqeIyQ08mp6jQ00AAY1HqAJSJGTwkaE/VGm0T R6Q9IGEMTTIYJglAgkyaCep6ptqZMUNADIMjRoAAkVPUakejSNPKGjTI0000NAaAAAAkkICejUyD U2iYUT2EnpR+qeSaDT0gH6pKQCJuoyrXeuuXbVn+jd5aLftf2+bHT7ST77SO5hkoS5YVSJsMN9UJ hJxpdx4wkz7xBgwCJxBa/65pcF+xcMyiqT+p+4nph9rNCteyQqaNmzPb9D7ekee9WXjQwYjKPDw9 F3HZWh+MvFf1z+9miTWV5K1uzSJtG19ciIYLpXuEPsRxRwjK5WfLIx7ZL3LrzUYKtsvDKuIpmXgs oC33YkE3+G3W7HW3g6H8EzMzmmfm/F5TzPG0DcYBtRICvYeQx0zXQr3HTo4fKQQGKQgxQpFLoglB 8zyqUsGOaOKtNGFpsbcQBFcIsU6ReAmTSM86RiFRpGCTD8kpgQk6Cnn4kz4Z0FqjTAZEPjz2GcCw mZ93VN0uij7q8kFAhFtTeBQBrT1aW81RhmTx4gacCgCcNEKYJAyu0BBgIsEMw49CXgyWYnnHg5Fg xA+IbQMFiFwGFV9c5lIClhAvwpkFc5lKB5obwNwOyF+fo9eFkZihozDg4K0NzLOFazGRdjVEK1ci 2dtA5VVFIG3abB5ktA1FwVxYkF5rOYbgWAUmUfoNGJYfxOIaA1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dFikvqMIeytg6FE7FHxP mEjBUNvKaF2CKZDDPIYfeXMgmZCrUsb4gf4u5IpwoSDF/3D8
Attachment:
python-fedora-devel-593.patch.sig
Description: PGP signature
_______________________________________________ infrastructure mailing list infrastructure@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/infrastructure