Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
FestplattenSchnitzel committed May 28, 2024
1 parent 196ef69 commit 495eb87
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pycroft/lib/finance/repayment/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ class IBANField(fields.Field):
to a string.
"""

def _deserialize(self, value: Any, attr: str | None, data: Mapping[str, Any], **kwargs) -> IBAN:
def _deserialize(

Check failure on line 12 in pycroft/lib/finance/repayment/fields.py

View workflow job for this annotation

GitHub Actions / python-lint

Error

Function is missing a type annotation for one or more arguments [no-untyped-def]
self, value: Any, attr: str | None, data: Mapping[str, Any], **kwargs
) -> IBAN:
try:
return IBAN(value, validate_bban=True)
except ValueError as error:
Expand Down
16 changes: 16 additions & 0 deletions pycroft/model/repayment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from sqlalchemy import String, ForeignKey
from sqlalchemy.orm import relationship, Mapped, mapped_column

Check failure on line 2 in pycroft/model/repayment.py

View workflow job for this annotation

GitHub Actions / python-lint

Ruff (F401)

pycroft/model/repayment.py:2:28: F401 `sqlalchemy.orm.relationship` imported but unused

from pycroft.model.base import IntegerIdModel


class RepaymentRequest(IntegerIdModel):
"""A request for transferring back excess membership contributions"""

id: Mapped[int] = mapped_column(primary_key=True)
user_id: Mapped[int] = mapped_column(
ForeignKey("user.id", ondelete="CASCADE", onupdate="CASCADE")
)
beneficiary: Mapped[str] = mapped_column(nullable=False)
iban: Mapped[str] = mapped_column(String, nullable=False)
amount: Mapped[Decimal] = mapped_column(Decimal, nullable=False)

Check failure on line 16 in pycroft/model/repayment.py

View workflow job for this annotation

GitHub Actions / python-lint

Ruff (F821)

pycroft/model/repayment.py:16:20: F821 Undefined name `Decimal`

Check failure on line 16 in pycroft/model/repayment.py

View workflow job for this annotation

GitHub Actions / python-lint

Ruff (F821)

pycroft/model/repayment.py:16:45: F821 Undefined name `Decimal`
5 changes: 5 additions & 0 deletions web/blueprints/finance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1621,3 +1621,8 @@ def payment_reminder_mail() -> ResponseReturnValue:
page_title="Zahlungserinnerungen per E-Mail versenden",
form_args=form_args,
form=form)

@bp.route("/repayment_requests", methods=("GET", "POST"))
@access.require("finance_change")
def handle_repayment_requests() -> ResponseReturnValue:
return render_template()

Check failure on line 1628 in web/blueprints/finance/__init__.py

View workflow job for this annotation

GitHub Actions / python-lint

Error

Missing positional argument "template_name_or_list" in call to "render_template" [call-arg]

0 comments on commit 495eb87

Please sign in to comment.