Skip to content
Snippets Groups Projects

No more protocols without date

Merged Magnus Giesbert requested to merge (removed):fix-protocols-without-date into master
1 unresolved thread

Check if a protocol has a date attached to it after parsing. If not, give it the current date. fixes #237 (closed)

Also fixes an issue in upload_new_protocol_by_file.

Edited by Magnus Giesbert

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
168 168 if protocol is None:
169 169 raise Exception("No protocol given. Aborting parsing.")
170 170 parse_protocol_async_inner(protocol)
171 if protocol.date is None :
172 initialdate = datetime.now().date()
173 protocol.date = initialdate
174 db.session.commit()
175 _make_error(protocol, "Parsing", "No initial date given, use current date instead.", initialdate)
  • Arg der fix löst das Problem nicht komplett. Bis parse_protocol_async durch ist existiert ja immer noch temporär ein Protokoll ohne Datum.

    Es wäre wahrscheinlich klüger beim erstellen des Protokolls diesem schon ein Datum zu geben und ein leicht modifiziertes parsing zu machen was den Fehler, dass das Datum im System und im geparsten nicht übereinstimmen, ignoriert und das Datum was im geparsten steht übernimmt.

  • Magnus Giesbert marked this merge request as draft

    marked this merge request as draft

  • added 1 commit

    • 3c5033be - Allow `fill_from_remarks` to ignore the old protocol date

    Compare with previous version

  • added 1 commit

    • 2c2eca3c - give `parse_protocol`, `parse_protocol_async` and `parse_protocol_async_inner`...

    Compare with previous version

  • added 1 commit

    • 8caa2226 - Have `upload_new_protocol` give protocols an initial date and then overwrite...

    Compare with previous version

  • Magnus Giesbert marked this merge request as ready

    marked this merge request as ready

  • Auch wenn ich mit der ignore_old_date Lösung nicht ganz zufrieden bin (das durchreichen einer Option zwischen mehreren Funktionen ist meiner Ansicht nach meh), löst es das Problem.

  • Robin Sonnabend approved this merge request

    approved this merge request

  • Robin Sonnabend mentioned in commit 7d3e3ed5

    mentioned in commit 7d3e3ed5

  • Danke für die Änderungen, sind alle gemerged und deployed.

  • Please register or sign in to reply
    Loading