Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : master
---------------------------------------------------------------
commit bf7da5839bc8865cc13a5842d0b1cebb81ddd2a7
Author: Richard Marko <rmarko(a)fedoraproject.org>
Date: Mon Jan 27 13:59:52 2014 +0100
[frontend] use isdigit instead of is_int
Signed-off-by: Richard Marko <rmarko(a)fedoraproject.org>
---------------------------------------------------------------
coprs_frontend/coprs/helpers.py | 9 ---------
coprs_frontend/coprs/views/api_ns/api_general.py | 2 +-
2 files changed, 1 insertions(+), 10 deletions(-)
diff --git a/coprs_frontend/coprs/helpers.py b/coprs_frontend/coprs/helpers.py
index 048042a..2074bdb 100644
--- a/coprs_frontend/coprs/helpers.py
+++ b/coprs_frontend/coprs/helpers.py
@@ -157,15 +157,6 @@ def render_repo(copr, mock_chroot, url):
return flask.render_template("coprs/copr.repo", copr=copr, url=url)
-def is_int(s):
- """ Return True is argument is integer number. False otherwise.
"""
- try:
- int(s)
- return True
- except ValueError:
- return False
-
-
class Serializer(object):
def to_dict(self, options={}):
diff --git a/coprs_frontend/coprs/views/api_ns/api_general.py
b/coprs_frontend/coprs/views/api_ns/api_general.py
index 92077e0..166ad13 100644
--- a/coprs_frontend/coprs/views/api_ns/api_general.py
+++ b/coprs_frontend/coprs/views/api_ns/api_general.py
@@ -198,7 +198,7 @@ def copr_new_build(username, coprname):
@api_ns.route("/coprs/build_status/<build_id>/",
methods=["GET"])
@api_login_required
def build_status(build_id):
- if helpers.is_int(build_id):
+ if build_id.isdigit():
build = builds_logic.BuildsLogic.get(build_id).first()
else:
build = None