2022-10-02 21:49:14 +00:00
|
|
|
from flask import render_template
|
2022-02-03 11:39:16 +00:00
|
|
|
from flask_login import login_required
|
2022-09-02 11:02:04 +00:00
|
|
|
from app.decorators import permission_required
|
|
|
|
from app.models import Permission
|
2022-02-03 11:39:16 +00:00
|
|
|
from . import bp
|
2022-10-02 21:49:14 +00:00
|
|
|
from .forms import ContributionForm
|
2022-02-03 11:39:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
@bp.before_request
|
|
|
|
@login_required
|
|
|
|
@permission_required(Permission.CONTRIBUTE)
|
|
|
|
def before_request():
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2022-10-02 21:49:14 +00:00
|
|
|
@bp.route('', methods=['GET', 'POST'])
|
2022-09-02 11:02:04 +00:00
|
|
|
def contributions():
|
2022-10-02 21:49:14 +00:00
|
|
|
form = ContributionForm(prefix='contribution-form')
|
|
|
|
return render_template(
|
|
|
|
'contributions/contribute.html.j2',
|
|
|
|
form=form,
|
|
|
|
title='Contribution'
|
|
|
|
)
|