Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
AE
Sith
Commits
fcfbfb3a
Commit
fcfbfb3a
authored
Aug 31, 2016
by
Skia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small file fix
parent
cb90ab8e
Pipeline
#158
failed with stage
in 1 minute and 47 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
core/migrations/0002_auto_20160831_0144.py
core/migrations/0002_auto_20160831_0144.py
+19
-0
core/models.py
core/models.py
+1
-1
core/views/files.py
core/views/files.py
+1
-2
No files found.
core/migrations/0002_auto_20160831_0144.py
0 → 100644
View file @
fcfbfb3a
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'sithfile'
,
name
=
'name'
,
field
=
models
.
CharField
(
verbose_name
=
'file name'
,
max_length
=
256
),
),
]
core/models.py
View file @
fcfbfb3a
...
...
@@ -446,7 +446,7 @@ def get_directory(instance, filename):
return
'./{0}/{1}'
.
format
(
instance
.
get_parent_path
(),
filename
)
class
SithFile
(
models
.
Model
):
name
=
models
.
CharField
(
_
(
'file name'
),
max_length
=
30
,
blank
=
False
)
name
=
models
.
CharField
(
_
(
'file name'
),
max_length
=
256
,
blank
=
False
)
parent
=
models
.
ForeignKey
(
'self'
,
related_name
=
"children"
,
verbose_name
=
_
(
"parent"
),
null
=
True
,
blank
=
True
)
file
=
models
.
FileField
(
upload_to
=
get_directory
,
verbose_name
=
_
(
"file"
),
null
=
True
,
blank
=
True
)
owner
=
models
.
ForeignKey
(
User
,
related_name
=
"owned_files"
,
verbose_name
=
_
(
"owner"
))
...
...
core/views/files.py
View file @
fcfbfb3a
...
...
@@ -58,8 +58,7 @@ class AddFilesForm(forms.Form):
new_file
.
clean
()
new_file
.
save
()
except
Exception
as
e
:
self
.
add_error
(
None
,
_
(
"Error uploading file %(file_name)s: %(msg)s"
)
%
{
'file_name'
:
f
,
'msg'
:
str
(
e
.
message
)})
self
.
add_error
(
None
,
_
(
"Error uploading file %(file_name)s: %(msg)s"
)
%
{
'file_name'
:
f
,
'msg'
:
repr
(
e
)})
class
FileListView
(
ListView
):
template_name
=
'core/file_list.jinja'
...
...
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