diff options
author | 2018-06-19 22:04:50 +0000 | |
---|---|---|
committer | 2018-06-19 22:04:50 +0000 | |
commit | 60337c6881d0e0409693e077b6165ec1cf81f8b5 (patch) | |
tree | c4172b5cc37502eb3ebe57bd93917b1da218c0f1 /pysite | |
parent | Disable the join button if the user has already applied to a code jam (diff) |
Make it a class method (review comment)
Diffstat (limited to 'pysite')
-rw-r--r-- | pysite/views/main/jams/index.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pysite/views/main/jams/index.py b/pysite/views/main/jams/index.py index f05f6b79..5c5b172a 100644 --- a/pysite/views/main/jams/index.py +++ b/pysite/views/main/jams/index.py @@ -17,12 +17,6 @@ class JamsIndexView(RouteView, DBMixin): .limit(5) ) - def has_applied_to_jam(jam): - # whether the user has applied to this jam - if not self.logged_in: - return False - return self.get_jam_response(jam, self.user_data["user_id"]) - jams = self.db.run(query, coerce=list) return self.render("main/jams/index.html", jams=jams, has_applied_to_jam=has_applied_to_jam) @@ -33,3 +27,9 @@ class JamsIndexView(RouteView, DBMixin): if result: return result[0] return None + + def has_applied_to_jam(self, jam): + # whether the user has applied to this jam + if not self.logged_in: + return False + return self.get_jam_response(jam, self.user_data["user_id"]) |