Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
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
humanities
gargantext
Commits
e6976aeb
Commit
e6976aeb
authored
May 11, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UPLOAD]: catching OsERROR from upload limit and managing view
parent
5866a043
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
constants.py
gargantext/constants.py
+1
-2
projects.py
gargantext/views/pages/projects.py
+15
-3
No files found.
gargantext/constants.py
View file @
e6976aeb
...
...
@@ -246,8 +246,7 @@ from .settings import BASE_DIR
# uploads/.gitignore prevents corpora indexing
# copora can be either a folder or symlink towards specific partition
UPLOAD_DIRECTORY
=
os
.
path
.
join
(
BASE_DIR
,
'uploads/corpora'
)
UPLOAD_LIMIT
=
1024
#* 1024 * 1024
UPLOAD_LIMIT
=
1024
*
1024
*
1024
DOWNLOAD_DIRECTORY
=
UPLOAD_DIRECTORY
...
...
gargantext/views/pages/projects.py
View file @
e6976aeb
...
...
@@ -95,10 +95,22 @@ def project(request, project_id):
name
=
request
.
POST
[
'name'
],
typename
=
'CORPUS'
,
)
corpus
.
add_resource
(
type
=
int
(
request
.
POST
[
'type'
]),
path
=
upload
(
request
.
FILES
[
'file'
]),
try
:
corpus
.
add_resource
(
type
=
int
(
request
.
POST
[
'type'
]),
path
=
upload
(
request
.
FILES
[
'file'
]),
)
except
OSError
:
#file upload limit in files.py
return
render
(
template_name
=
'pages/projects/wait.html'
,
request
=
request
,
context
=
{
'user'
:
request
.
user
,
'project'
:
project
,
},
)
session
.
add
(
corpus
)
session
.
commit
()
...
...
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