Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix an attribute typo #26

Closed
wants to merge 1 commit into from
Closed

fix an attribute typo #26

wants to merge 1 commit into from

Conversation

Ahmed-10
Copy link

fix: "AttributeError: Storage object has no attribute bucket"

line 419 storage has attribute storage_bucket not bucket
@nhorvath
Copy link
Owner

I think you probably just forgot to init storage with credentials. self.storage_bucket is just a string url. self.bucket is the actual bucket object.

    """ Storage Service """
    def __init__(self, credentials, storage_bucket, requests):
        self.storage_bucket = "https://firebasestorage.googleapis.com/v0/b/" + storage_bucket
        self.credentials = credentials
        self.requests = requests
        self.path = ""
        if credentials:
            client = storage.Client(credentials=credentials, project=storage_bucket)
-->         self.bucket = client.get_bucket(storage_bucket)

@Ahmed-10
Copy link
Author

So in order to use delete method, I need to get credentials with firebase_admin.credentials and initialize the storage with these credentials

@nhorvath
Copy link
Owner

nhorvath commented Jan 16, 2021 via email

@Ahmed-10
Copy link
Author

Thank you for your explanation، If you don't mind I would love to add this to the documentation in the next couple of days.

@Ahmed-10 Ahmed-10 closed this Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants