Skip to content
Snippets Groups Projects
Commit c24faafd authored by Tomáš Valenta's avatar Tomáš Valenta
Browse files

delete to-be-approved notice

parent d6f2e9f7
Branches
No related tags found
No related merge requests found
Pipeline #13844 passed
......@@ -314,6 +314,7 @@ class ContractAdmin(
def save_model(self, request, obj, form, change):
is_new = obj.created_by is None
print(is_new)
# Need to generate primary keys first
parent_save_response = super().save_model(request, obj, form, change)
......@@ -336,13 +337,12 @@ class ContractAdmin(
from users.models import User
if is_new or obj.status != form.initial["status"]:
headers = {
"Authorization": f"Token {settings.NASTENKA_API_TOKEN}",
"Content-Type": "application/json",
}
if obj.status == obj.StatusTypes.WORK_IN_PROGRESS:
if not is_new and obj.status == obj.StatusTypes.WORK_IN_PROGRESS:
try:
user = User.objects.filter(id=obj.created_by.id).first()
......@@ -385,7 +385,8 @@ class ContractAdmin(
'Failed to send out "contract returned for editing" Nástěnka notification: %s',
str(exception),
)
elif obj.status == obj.StatusTypes.TO_BE_APPROVED:
elif is_new or obj.status != form.initial["status"]:
if obj.status == obj.StatusTypes.TO_BE_APPROVED:
try:
sso_ids = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment