Skip to content
This repository has been archived by the owner on May 9, 2018. It is now read-only.

Commit

Permalink
Handle users with no f2p attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
chromakode committed Apr 17, 2013
1 parent f624c97 commit 8cce85a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions reddit_f2p/steam.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def make_post_login_url():
@validate(VUser(),
error=nop("error"))
def GET_start(self, error):
f2p_status = getattr(c.user, "f2p")
f2p_status = getattr(c.user, "f2p", None)
error = bool(error)

if f2p_status == "participated":
Expand All @@ -71,7 +71,7 @@ def GET_start(self, error):
@validate(VUser(),
VModhash())
def POST_auth(self):
if getattr(c.user, "f2p") != "participated":
if getattr(c.user, "f2p", None) != "participated":
abort(403)

session = {}
Expand All @@ -86,7 +86,7 @@ def POST_auth(self):

@validate(VUser())
def GET_postlogin(self):
if getattr(c.user, "f2p") != "participated":
if getattr(c.user, "f2p", None) != "participated":
return redirect_to("/f2p/steam")

session = g.f2pcache.get("steam_session_%d" % c.user._id)
Expand Down

0 comments on commit 8cce85a

Please sign in to comment.