From 2015f8b332cd61deb4c6c0c47bdec1ad5057d4cf Mon Sep 17 00:00:00 2001 From: moanos Date: Tue, 29 Oct 2024 06:53:34 +0100 Subject: [PATCH] feat: Use new shortcuts when creating ANs --- src/fellchensammlung/views.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 84a196a..0e74158 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -205,16 +205,9 @@ def add_adoption_notice(request): # Set correct status if request.user.trust_level >= User.TRUST_LEVEL[User.COORDINATOR]: - major_status = AdoptionNoticeStatus.ACTIVE - minor_status = AdoptionNoticeStatus.MINOR_STATUS_CHOICES[AdoptionNoticeStatus.ACTIVE]["searching"] + instance.set_active() else: - major_status = AdoptionNoticeStatus.AWAITING_ACTION - minor_status = AdoptionNoticeStatus.MINOR_STATUS_CHOICES[AdoptionNoticeStatus.AWAITING_ACTION][ - "waiting_for_review"] - status = AdoptionNoticeStatus.objects.create(major_status=major_status, - minor_status=minor_status, - adoption_notice=instance) - status.save() + instance.set_to_review() # Get the species and number of animals from the form species = form.cleaned_data["species"]