Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
AURA
steering
Commits
b6457768
Commit
b6457768
authored
11 years ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
fixed addnote and importnote command after removal of owner to notes.
parent
ce745d33
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
program/management/commands/addnote.py
+2
-3
2 additions, 3 deletions
program/management/commands/addnote.py
program/management/commands/importnotes.py
+1
-3
1 addition, 3 deletions
program/management/commands/importnotes.py
with
3 additions
and
6 deletions
program/management/commands/addnote.py
+
2
−
3
View file @
b6457768
...
...
@@ -51,8 +51,7 @@ class Command(BaseCommand):
except
Exception
as
e
:
raise
CommandError
(
e
)
owner
=
show
.
owners
.
all
()[
0
]
if
show
.
owners
.
count
()
>
0
else
User
.
objects
.
get
(
pk
=
1
)
note
=
Note
(
timeslot
=
timeslot
,
owner
=
owner
,
title
=
title
,
content
=
''
.
join
(
lines
),
status
=
status
)
note
=
Note
(
timeslot
=
timeslot
,
title
=
title
,
content
=
''
.
join
(
lines
),
status
=
status
)
try
:
note
.
validate_unique
()
...
...
@@ -61,4 +60,4 @@ class Command(BaseCommand):
else
:
note
.
save
()
print
'
added note
"
%s
"
to
"
%s
"'
%
(
title
,
timeslot
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
program/management/commands/importnotes.py
+
1
−
3
View file @
b6457768
...
...
@@ -11,8 +11,6 @@ USER = 'helsinki'
PASSWD
=
'
helsinki
'
DB
=
'
helsinki
'
OWNER
=
User
.
objects
.
get
(
pk
=
1
)
class
Command
(
NoArgsCommand
):
help
=
'
Import notes from current program
'
...
...
@@ -47,7 +45,7 @@ WHERE n.sendung_id in (SELECT id FROM sendungen WHERE letzter_termin > current_d
except
MultipleObjectsReturned
:
print
'
multiple timeslots found for sendung
"
%s
"
and datum
"
%s
"'
%
(
stitel
,
datum
)
else
:
note
=
Note
(
timeslot
=
timeslot
,
owner
=
OWNER
,
title
=
ntitel
,
content
=
notiz
)
note
=
Note
(
timeslot
=
timeslot
,
title
=
ntitel
,
content
=
notiz
)
try
:
note
.
validate_unique
()
except
ValidationError
:
...
...
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