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
La Quadrature du Net
piphone
campaign
Commits
e4250010
Commit
e4250010
authored
Sep 05, 2017
by
Okhin
Browse files
Still this kind thing
parent
ff1ca8d2
Pipeline
#1194
passed with stages
in 1 minute and 48 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
picampaign/importer/models.py
View file @
e4250010
...
...
@@ -31,7 +31,7 @@ class Importer(models.Model):
def
kind
(
self
):
if
self
.
url
is
None
and
self
.
file
.
name
is
None
:
return
None
if
self
.
url
is
''
:
if
self
.
url
is
not
''
and
self
.
url
is
not
None
:
return
'url'
else
:
return
'file'
...
...
picampaign/importer/tests.py
View file @
e4250010
...
...
@@ -128,7 +128,7 @@ class ImporterTest(TestCase):
importer
=
Importer
.
objects
.
create
(
name
=
'test importer'
,
category
=
'repr'
,
campaign
=
self
.
campaign
,
campaign
=
self
.
campaign
,
)
self
.
assertEqual
(
importer
.
kind
(),
None
)
importer
.
file
=
'a'
...
...
@@ -145,7 +145,7 @@ class ImporterTest(TestCase):
importer
=
Importer
.
objects
.
create
(
name
=
'test importer'
,
category
=
'repr'
,
campaign
=
self
.
campaign
,
campaign
=
self
.
campaign
,
file
=
json_file
,
url
=
''
)
...
...
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