Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
rpteam
Revue de Press
Commits
6a5817ad
Commit
6a5817ad
authored
Mar 18, 2019
by
Okhin
Browse files
Linting and removing some non used imports
parent
07562156
Pipeline
#2501
passed with stages
in 3 minutes and 4 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
apps/rp/models.py
View file @
6a5817ad
from
django.db
import
models
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.core
import
files
from
django.core.files.base
import
ContentFile
from
taggit.managers
import
TaggableManager
from
newspaper
import
Article
as
ArticleParser
...
...
@@ -10,9 +9,7 @@ from django_fsm import FSMField, transition, RETURN_VALUE
from
io
import
BytesIO
from
datetime
import
datetime
from
tempfile
import
NamedTemporaryFile
from
project.settings
import
env
from
rp.utils
import
cleanup_url
...
...
@@ -158,14 +155,15 @@ class Article(VoteMixin):
else
:
return
self
.
status
@
transition
(
field
=
status
,
source
=
'NEW'
,
target
=
'NEW'
,
permission
=
"rp.can_vote"
)
@
transition
(
field
=
status
,
source
=
'NEW'
,
target
=
'NEW'
,
permission
=
"rp.can_vote"
)
@
transition
(
field
=
status
,
source
=
'DRAFT'
,
target
=
'DRAFT'
,
permission
=
"rp.can_vote"
)
def
downvote
(
self
,
by
=
None
):
"""
Downvote the article score for the given user and remove previous
votes.
Draft articles can be downvoted but will not be moved back in
the
_NEW_ queue.
Downvote the article score for the given user and remove previous
votes.
Draft articles can be downvoted but will not be moved back in
the
_NEW_ queue.
"""
super
(
Article
,
self
).
downvote
(
by
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment