Revision ee4aa6eb snf-astakos-app/astakos/im/functions.py

b/snf-astakos-app/astakos/im/functions.py
646 646
        trigger_sync()
647 647
    return membership
648 648

  
649
def submit_application(**kw):
649
def submit_application(kw, request_user=None):
650

  
651
    kw['applicant'] = request_user
650 652

  
651 653
    precursor_id = kw.get('precursor_application', None)
652 654
    if precursor_id is not None:
......
654 656
        precursor = sfu.get(id=precursor_id)
655 657
        kw['precursor_application'] = precursor
656 658

  
659
        if request_user and \
660
            (not precursor.owner == request_user and \
661
                not request_user.is_superuser):
662
            raise PermissionDenied(_(astakos_messages.NOT_ALLOWED))
663

  
657 664
    application = models_submit_application(**kw)
658 665

  
659 666
    try:

Also available in: Unified diff