[copr] master: No need of auth when listing someone's copr (2a93e76)

pingou at fedoraproject.org pingou at fedoraproject.org
Sun Mar 10 08:39:49 UTC 2013


Repository : http://git.fedorahosted.org/cgit/copr.git

On branch  : master

>---------------------------------------------------------------

commit 2a93e762f114851f67e6403fdb854441c0d39245
Author: Pierre-Yves Chibon <pingou at pingoured.fr>
Date:   Sun Mar 10 09:31:56 2013 +0100

    No need of auth when listing someone's copr


>---------------------------------------------------------------

 copr_cli/subcommands.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/copr_cli/subcommands.py b/copr_cli/subcommands.py
index 5da9c76..2931ca6 100644
--- a/copr_cli/subcommands.py
+++ b/copr_cli/subcommands.py
@@ -43,13 +43,16 @@ def get_api_url():
 
 def list(username=None):
     """ List all the copr of a user. """
-    user = get_user()
+    user = {}
+    if not username:
+        user = get_user()
+        del(user['token'])
+
     copr_api_url = get_api_url()
     url = '{0}/owned/'.format(copr_api_url)
 
     if username:
         user['username'] = username
-    del(user['token'])
 
     req = requests.get(url, params=user)
     output = json.loads(req.text)



More information about the copr-devel mailing list