external delete button
This commit is contained in:
@ -27,7 +27,7 @@ class Dropbox(Provider):
|
||||
try:
|
||||
recipes = r.json()
|
||||
except ValueError:
|
||||
log_entry = SyncLog(status='ERROR', msg=str(r), monitor=monitor)
|
||||
log_entry = SyncLog(status='ERROR', msg=str(r), sync=monitor)
|
||||
log_entry.save()
|
||||
return r
|
||||
|
||||
@ -105,3 +105,20 @@ class Dropbox(Provider):
|
||||
r = requests.post(url, headers=headers, data=json.dumps(data))
|
||||
|
||||
return r.json()
|
||||
|
||||
@staticmethod
|
||||
def delete_file(recipe):
|
||||
url = "https://api.dropboxapi.com/2/files/delete_v2"
|
||||
|
||||
headers = {
|
||||
"Authorization": "Bearer " + recipe.storage.token,
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
|
||||
data = {
|
||||
"path": recipe.file_path
|
||||
}
|
||||
|
||||
r = requests.post(url, headers=headers, data=json.dumps(data))
|
||||
|
||||
return r.json()
|
||||
|
Reference in New Issue
Block a user