diff options
author | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2013-09-24 14:36:02 (GMT) |
---|---|---|
committer | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2013-09-24 14:36:02 (GMT) |
commit | b6457768e7feec8ca8ad0f6535f8fc91b046c799 (patch) | |
tree | be26180f4236ce3f4f9f5906f875456d7d512959 | |
parent | ce745d33cad169e6a06b41009620cb53b54ee18f (diff) |
fixed addnote and importnote command after removal of owner to notes.
-rw-r--r-- | program/management/commands/addnote.py | 5 | ||||
-rw-r--r-- | program/management/commands/importnotes.py | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/program/management/commands/addnote.py b/program/management/commands/addnote.py index 97ae885..f418e6e 100644 --- a/program/management/commands/addnote.py +++ b/program/management/commands/addnote.py @@ -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 + diff --git a/program/management/commands/importnotes.py b/program/management/commands/importnotes.py index 52999f5..287dcef 100644 --- a/program/management/commands/importnotes.py +++ b/program/management/commands/importnotes.py @@ -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: |