Revision 64d0c13e

b/snf-astakos-app/astakos/im/functions.py
771 771
    return application
772 772

  
773 773

  
774
def cancel_application(application_id, request_user=None):
774
def cancel_application(application_id, request_user=None, reason=""):
775 775
    application = get_application_for_update(application_id)
776 776
    checkAllowed(application, request_user)
777 777

  
......
786 786
    logger.info("%s has been cancelled." % (application.log_display))
787 787

  
788 788

  
789
def dismiss_application(application_id, request_user=None):
789
def dismiss_application(application_id, request_user=None, reason=""):
790 790
    application = get_application_for_update(application_id)
791 791
    checkAllowed(application, request_user)
792 792

  
......
799 799
    logger.info("%s has been dismissed." % (application.log_display))
800 800

  
801 801

  
802
def deny_application(application_id, request_user=None, reason=None):
802
def deny_application(application_id, request_user=None, reason=""):
803 803
    application = get_application_for_update(application_id)
804 804

  
805 805
    checkAllowed(application, request_user, admin_only=True)
......
811 811

  
812 812
    qh_release_pending_app(application.owner)
813 813

  
814
    if reason is None:
815
        reason = ""
816 814
    application.deny(reason)
817 815
    logger.info("%s has been denied with reason \"%s\"." %
818 816
                (application.log_display, reason))
819 817
    application_deny_notify(application)
820 818

  
821 819

  
822
def approve_application(app_id, request_user=None):
820
def approve_application(app_id, request_user=None, reason=""):
823 821

  
824 822
    try:
825 823
        objects = ProjectApplication.objects
......
836 834
        raise PermissionDenied(m)
837 835

  
838 836
    qh_release_pending_app(application.owner)
839
    project = application.approve()
837
    project = application.approve(reason)
840 838
    qh_sync_projects([project])
841 839
    logger.info("%s has been approved." % (application.log_display))
842 840
    application_approve_notify(application)
b/snf-astakos-app/astakos/im/models.py
1617 1617
    def can_approve(self):
1618 1618
        return self.state == self.PENDING
1619 1619

  
1620
    def approve(self):
1620
    def approve(self, reason):
1621 1621
        new_project_name = self.name
1622 1622
        if not self.can_approve():
1623 1623
            m = _("cannot approve: project '%s' in state '%s'") % (
......
1651 1651

  
1652 1652
        self.state = self.APPROVED
1653 1653
        self.response_date = now
1654
        self.response = reason
1654 1655
        self.save()
1655 1656
        return project
1656 1657

  

Also available in: Unified diff