Skip to content

docs: snippets example raises AttributeError #954

@matusf

Description

@matusf

In file: snippets
Under section: "Update the snippet attributes:"
There is an example:

snippet.visibility_level = gitlab.Project.VISIBILITY_PUBLIC
snippet.save()

However, gitlab does not have attribute Project:

>>> import gitlab
>>> gitlab.__version__
'1.13.0'
>>> gitlab.Project.VISIBILITY_PUBLIC
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    gitlab.Project.VISIBILITY_PUBLIC
AttributeError: module 'gitlab' has no attribute 'Project'
>>>
>>> # this works:
>>> gitlab.VISIBILITY_PUBLIC
20

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions