Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chiefs
ChiefSend
Commits
a5e63b58
Commit
a5e63b58
authored
Jan 06, 2021
by
contabo-server
Browse files
fix delete condition
parent
5fca45f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/routes.py
View file @
a5e63b58
...
...
@@ -17,7 +17,7 @@ def get_and_check_share(share_id, decrease_limit=False) -> Share:
if
share
.
download_limit
and
decrease_limit
:
share
.
download_limit
-=
1
db
.
session
.
commit
()
if
(
share
.
download_limit
and
share
.
download_limit
<
0
)
or
\
if
(
share
.
download_limit
and
share
.
download_limit
<
=
0
)
or
\
(
share
.
expires
is
not
None
and
datetime
.
now
()
>
share
.
expires
):
que
.
enqueue
(
delete_share
,
share
.
id
)
return
None
...
...
@@ -134,7 +134,7 @@ def media(share_id, filename):
@
app
.
route
(
'/d/<string:share_id>zip'
)
def
zip_attachments
(
share_id
):
share
=
get_and_check_share
(
share_id
)
share
=
get_and_check_share
(
share_id
,
decrease_limit
=
True
)
if
share
is
None
:
return
redirect
(
url_for
(
'expired'
))
if
share
.
password
:
if
share_id
not
in
session
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment