view SO review screen / DD-254 page
This commit is contained in:
@@ -39,7 +39,13 @@ class Authorization(object):
|
||||
@classmethod
|
||||
def check_is_ko(cls, user, task_order):
|
||||
if task_order.contracting_officer != user:
|
||||
message = "review Task Order {}".format(task_order.id)
|
||||
message = "review task order {}".format(task_order.id)
|
||||
raise UnauthorizedError(user, message)
|
||||
|
||||
@classmethod
|
||||
def check_is_so(cls, user, task_order):
|
||||
if task_order.security_officer != user:
|
||||
message = "review task order {}".format(task_order.id)
|
||||
raise UnauthorizedError(user, message)
|
||||
|
||||
@classmethod
|
||||
|
38
atst/forms/dd_254.py
Normal file
38
atst/forms/dd_254.py
Normal file
@@ -0,0 +1,38 @@
|
||||
from wtforms.fields import SelectMultipleField, StringField
|
||||
from wtforms.fields.html5 import TelField
|
||||
from wtforms.widgets import ListWidget, CheckboxInput
|
||||
from wtforms.validators import Required
|
||||
|
||||
from atst.forms.validators import PhoneNumber
|
||||
|
||||
from .forms import CacheableForm
|
||||
from .data import REQUIRED_DISTRIBUTIONS
|
||||
from atst.utils.localization import translate
|
||||
|
||||
|
||||
class DD254Form(CacheableForm):
|
||||
certifying_official = StringField(
|
||||
translate("forms.dd_254.certifying_official.label"),
|
||||
description=translate("forms.dd_254.certifying_official.description"),
|
||||
validators=[Required()],
|
||||
)
|
||||
co_title = StringField(
|
||||
translate("forms.dd_254.co_title.label"), validators=[Required()]
|
||||
)
|
||||
co_address = StringField(
|
||||
translate("forms.dd_254.co_address.label"),
|
||||
description=translate("forms.dd_254.co_address.description"),
|
||||
validators=[Required()],
|
||||
)
|
||||
co_phone = TelField(
|
||||
translate("forms.dd_254.co_phone.label"),
|
||||
description=translate("forms.dd_254.co_phone.description"),
|
||||
validators=[Required(), PhoneNumber()],
|
||||
)
|
||||
required_distribution = SelectMultipleField(
|
||||
translate("forms.dd_254.required_distribution.label"),
|
||||
choices=REQUIRED_DISTRIBUTIONS,
|
||||
default="",
|
||||
widget=ListWidget(prefix_label=False),
|
||||
option_widget=CheckboxInput(),
|
||||
)
|
@@ -11,6 +11,7 @@ from atst.domain.authz import Authorization
|
||||
from atst.forms.officers import EditTaskOrderOfficersForm
|
||||
from atst.models.task_order import Status as TaskOrderStatus
|
||||
from atst.forms.ko_review import KOReviewForm
|
||||
from atst.forms.dd_254 import DD254Form
|
||||
|
||||
|
||||
@portfolios_bp.route("/portfolios/<portfolio_id>/task_orders")
|
||||
@@ -154,3 +155,12 @@ def edit_task_order_invitations(portfolio_id, task_order_id):
|
||||
task_order=task_order,
|
||||
form=form,
|
||||
)
|
||||
|
||||
|
||||
@portfolios_bp.route("/portfolios/<portfolio_id>/task_order/<task_order_id>/dd254")
|
||||
def so_review(portfolio_id, task_order_id):
|
||||
task_order = TaskOrders.get(g.current_user, task_order_id)
|
||||
form = DD254Form()
|
||||
|
||||
Authorization.check_is_so(g.current_user, task_order)
|
||||
return render_template("portfolios/task_orders/so_review.html", form=form)
|
||||
|
Reference in New Issue
Block a user