| |
@@ -185,22 +185,29 @@
|
| |
|
| |
comment = form.comment.data
|
| |
depends = []
|
| |
- for depend in form.depending.data.split(","):
|
| |
- if depend.strip():
|
| |
- try:
|
| |
- depends.append(int(depend.strip()))
|
| |
- except ValueError:
|
| |
- pass
|
| |
+ # This field is optional, check if it's filled first
|
| |
+ if form.depending.data:
|
| |
+ for depend in form.depending.data.split(","):
|
| |
+ if depend.strip():
|
| |
+ try:
|
| |
+ depends.append(int(depend.strip()))
|
| |
+ except ValueError:
|
| |
+ pass
|
| |
|
| |
blocks = []
|
| |
- for block in form.blocking.data.split(","):
|
| |
- if block.strip():
|
| |
- try:
|
| |
- blocks.append(int(block.strip()))
|
| |
- except ValueError:
|
| |
- pass
|
| |
-
|
| |
- assignee = form.assignee.data.strip() or None
|
| |
+ # Check if the optional field is filled
|
| |
+ if form.blocking.data:
|
| |
+ for block in form.blocking.data.split(","):
|
| |
+ if block.strip():
|
| |
+ try:
|
| |
+ blocks.append(int(block.strip()))
|
| |
+ except ValueError:
|
| |
+ pass
|
| |
+
|
| |
+ assignee = None
|
| |
+ # Check if the optional field is filled
|
| |
+ if form.assignee.data:
|
| |
+ assignee = form.assignee.data.strip()
|
| |
new_status = form.status.data.strip() or None
|
| |
close_status = form.close_status.data or None
|
| |
if close_status not in repo.close_status:
|
| |
@@ -211,7 +218,10 @@
|
| |
new_priority = int(form.priority.data)
|
| |
except (ValueError, TypeError):
|
| |
pass
|
| |
- tags = [tag.strip() for tag in form.tag.data.split(",") if tag.strip()]
|
| |
+ tags = []
|
| |
+ # Check if the optional field is filled
|
| |
+ if form.tag.data:
|
| |
+ tags = [tag.strip() for tag in form.tag.data.split(",")]
|
| |
|
| |
new_milestone = None
|
| |
try:
|
| |
This PR is trying to improve the tests by various ways:
I will try to work on the tests a little more. But this is ready to be merged.