Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
E
esi-table-data
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esi-data-scrapping
esi-table-data
Commits
d8a43980
Commit
d8a43980
authored
Sep 26, 2017
by
Andrii Marynets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete old code base
parent
12b9e0e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
11 deletions
+2
-11
forms.py
esi/scraper/forms.py
+1
-1
views.py
esi/scraper/views.py
+1
-10
No files found.
esi/scraper/forms.py
View file @
d8a43980
from
django
import
forms
from
.models
import
Job
,
Spider
from
.models
import
Job
class
JobForm
(
forms
.
ModelForm
):
...
...
esi/scraper/views.py
View file @
d8a43980
...
...
@@ -95,6 +95,7 @@ class EditJobView(UpdateView):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
form
=
JobForm
(
request
.
POST
,
instance
=
Job
.
objects
.
get
(
pk
=
kwargs
.
get
(
'id'
)))
if
form
.
is_valid
():
form
.
test
()
job
=
form
.
save
()
else
:
return
HttpResponse
(
'Bad request'
,
status
=
400
)
...
...
@@ -141,13 +142,3 @@ def schedule(interval, every):
scheduler
[
'minute'
]
=
'*/2'
scheduler
[
'hour'
]
=
'*'
return
scheduler
def
validate_query
(
query
):
query
=
query
.
lower
()
block
=
[
';'
,
'select'
,
'alter'
,
'drop'
,
'truncate'
,
'update'
]
if
any
(
ext
in
query
for
ext
in
block
):
print
(
'Query is blocked'
)
return
BAD_QUERY
else
:
return
query
Write
Preview
Markdown
is supported
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