Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
elixire
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ave
elixire
Commits
54f99491
Commit
54f99491
authored
6 years ago
by
Luna Mendes
Browse files
Options
Downloads
Patches
Plain Diff
api.files: use purge_cf
parent
3583ddf5
Branches
1-testing
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/bp/files.py
+4
-3
4 additions, 3 deletions
api/bp/files.py
with
4 additions
and
3 deletions
api/bp/files.py
+
4
−
3
View file @
54f99491
import
os
import
logging
import
logging
from
sanic
import
Blueprint
from
sanic
import
Blueprint
from
sanic
import
response
from
sanic
import
response
from
..common
import
purge_cf
_cache_file
,
purge_cf_cache_shorten
from
..common
import
purge_cf
,
FileNameType
from
..common_auth
import
token_check
from
..common_auth
import
token_check
from
..errors
import
NotFound
from
..errors
import
NotFound
...
@@ -83,7 +84,7 @@ async def delete_handler(request):
...
@@ -83,7 +84,7 @@ async def delete_handler(request):
if
exec_out
==
"
UPDATE 0
"
:
if
exec_out
==
"
UPDATE 0
"
:
raise
NotFound
(
'
You have no files with this name.
'
)
raise
NotFound
(
'
You have no files with this name.
'
)
await
purge_cf
_cache_file
(
request
.
app
,
file_name
)
await
purge_cf
(
request
.
app
,
file_name
,
FileNameType
.
FILE
)
return
response
.
json
({
return
response
.
json
({
'
success
'
:
True
'
success
'
:
True
...
@@ -109,7 +110,7 @@ async def shortendelete_handler(request):
...
@@ -109,7 +110,7 @@ async def shortendelete_handler(request):
if
exec_out
==
"
UPDATE 0
"
:
if
exec_out
==
"
UPDATE 0
"
:
raise
NotFound
(
'
You have no shortens with this name.
'
)
raise
NotFound
(
'
You have no shortens with this name.
'
)
await
purge_cf
_cache_shorten
(
request
.
app
,
file_name
)
await
purge_cf
(
request
.
app
,
file_name
,
FileNameType
.
SHORTEN
)
return
response
.
json
({
return
response
.
json
({
'
success
'
:
True
'
success
'
:
True
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment