Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
daisy
Manage
Activity
Members
Plan
External wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixir
daisy
Commits
d917db9a
Commit
d917db9a
authored
5 years ago
by
Jacek Lebioda
Committed by
Valentin Grouès
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
feat: make document's notes an optional field
parent
08f65e6d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/migrations/0011_auto_20200130_1138.py
+18
-0
18 additions, 0 deletions
core/migrations/0011_auto_20200130_1138.py
core/models/document.py
+2
-2
2 additions, 2 deletions
core/models/document.py
with
20 additions
and
2 deletions
core/migrations/0011_auto_20200130_1138.py
0 → 100644
+
18
−
0
View file @
d917db9a
# Generated by Django 2.2.8 on 2020-01-30 10:38
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
core
'
,
'
0010_document_expiry_date
'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'
document
'
,
name
=
'
content_notes
'
,
field
=
models
.
TextField
(
blank
=
True
,
null
=
True
,
verbose_name
=
'
Document Notes
'
),
),
]
This diff is collapsed.
Click to expand it.
core/models/document.py
+
2
−
2
View file @
d917db9a
...
...
@@ -49,7 +49,7 @@ class Document(CoreModel):
content
=
models
.
FileField
(
upload_to
=
get_file_name
)
content_url
=
models
.
URLField
(
verbose_name
=
'
Document Url
'
,
null
=
True
,
blank
=
True
)
content_notes
=
models
.
TextField
(
verbose_name
=
'
Document Notes
'
,
blank
=
Fals
e
,
blank
=
Tru
e
,
null
=
True
)
domain_type
=
models
.
TextField
(
verbose_name
=
'
Domain Type
'
,
choices
=
type
,
default
=
type
.
not_specified
)
...
...
@@ -76,4 +76,4 @@ class Document(CoreModel):
@receiver
(
post_delete
,
sender
=
Document
,
dispatch_uid
=
'
document_delete
'
)
def
document_cleanup
(
sender
,
instance
,
**
kwargs
):
if
hasattr
(
instance
.
content
,
'
path
'
)
and
os
.
path
.
exists
(
instance
.
content
.
path
):
default_storage
.
delete
(
instance
.
content
.
path
)
\ No newline at end of file
default_storage
.
delete
(
instance
.
content
.
path
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment