From a636d5ab25d2b248d89363ac86ecad7a0b90f100 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Thu, 31 Dec 2015 06:37:44 +0100 Subject: Provide a create method for GitlabObject's Instead of using the constructor to do everything (get, list and create), we now provide a class method for each action. This should make code easier to read. --- gitlab/cli.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gitlab/cli.py') diff --git a/gitlab/cli.py b/gitlab/cli.py index c3289df..2874a5f 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -149,8 +149,7 @@ def do_create(cls, gl, what, args): die("%s objects can't be created" % what) try: - o = cls(gl, args) - o.save() + o = cls.create(gl, args) except Exception as e: die("Impossible to create object (%s)" % str(e)) -- cgit v1.2.1