| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7e61a28 commit a636d5a
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -761,6 +761,16 @@ def delete(self, **kwargs): | |||
| 761 | 761 | ||
| 762 | 762 | return self.gitlab.delete(self, **kwargs) | |
| 763 | 763 | ||
| 764 | + @classmethod | ||
| 765 | + def create(cls, gl, data, **kwargs): | ||
| 766 | + if not cls.canCreate: | ||
| 767 | + raise NotImplementedError | ||
| 768 | + | ||
| 769 | + obj = cls(gl, data, **kwargs) | ||
| 770 | + obj.save() | ||
| 771 | + | ||
| 772 | + return obj | ||
| 773 | + | ||
| 764 | 774 | def __init__(self, gl, data=None, **kwargs): | |
| 765 | 775 | self._created = False | |
| 766 | 776 | self.gitlab = gl | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -149,8 +149,7 @@ def do_create(cls, gl, what, args): | |||
| 149 | 149 | die("%s objects can't be created" % what) | |
| 150 | 150 | ||
| 151 | 151 | try: | |
| 152 | - o = cls(gl, args) | ||
| 153 | - o.save() | ||
| 152 | + o = cls.create(gl, args) | ||
| 154 | 153 | except Exception as e: | |
| 155 | 154 | die("Impossible to create object (%s)" % str(e)) | |
| 156 | 155 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments