Skip to content

Commit c3b938c

Browse files
committed
Allow for anonymous album creation in accordance with the API endpoint documentation
1 parent 3a285f7 commit c3b938c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

imgurpython/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,10 @@ def get_album_images(self, album_id):
286286
def create_album(self, fields):
287287
post_data = {field: fields[field] for field in set(self.allowed_album_fields).intersection(fields.keys())}
288288

289-
if 'ids' in post_data:
290-
self.logged_in()
291-
292-
return self.make_request('POST', 'album', data=post_data)
289+
if self.auth is None:
290+
return self.make_request('POST', 'album', post_data, True)
291+
else:
292+
return self.make_request('POST', 'album', post_data)
293293

294294
def update_album(self, album_id, fields):
295295
post_data = {field: fields[field] for field in set(self.allowed_album_fields).intersection(fields.keys())}
@@ -594,7 +594,7 @@ def upload(self, fd, config=None, anon=True):
594594
'type': 'base64',
595595
}
596596
data.update({meta: config[meta] for meta in set(self.allowed_image_fields).intersection(config.keys())})
597-
597+
598598
return self.make_request('POST', 'upload', data, anon)
599599

600600
def upload_from_url(self, url, config=None, anon=True):

0 commit comments

Comments
 (0)