Skip to content

Commit

Permalink
Merge pull request #9 from fedora-infra/feature/fix-unbound-session-e…
Browse files Browse the repository at this point in the history
…rror

Fix an 'unbound session' error.
  • Loading branch information
ralphbean committed Jul 12, 2014
2 parents 2220c65 + 4d6f4af commit 163e7af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions github2fedmsg/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ def home(request):
@view_config(name='sync', context=m.User, renderer='json')
def sync_user(request):
# TODO -- someday, learn how to do the __acls__ thing.. :/
username = request.context.username
userid = authenticated_userid(request)
if userid != request.context.username:
if userid != username:
raise HTTPUnauthorized()

config_key = 'github.secret_oauth_access_token'
Expand All @@ -43,7 +44,7 @@ def sync_user(request):
request.context.sync_repos(oauth_creds)
transaction.commit()
home = request.route_url('home')
raise HTTPFound(home + request.context.username)
raise HTTPFound(home + username)


@view_config(context="tw2.core.widgets.WidgetMeta",
Expand Down

0 comments on commit 163e7af

Please sign in to comment.