Skip to content

Commit

Permalink
fixup! Enable export of non-attributable transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
FestplattenSchnitzel committed May 8, 2024
1 parent ce1ee7f commit 5889b71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pycroft/lib/finance/retransfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

from sepaxml import SepaTransfer
from sqlalchemy import select
from sqlalchemy.orm import joinedload
from sqlalchemy.orm import joinedload, Session

from pycroft import config
from pycroft.helpers.utc import ensure_tz
from pycroft.model import session

Check failure on line 10 in pycroft/lib/finance/retransfer.py

View workflow job for this annotation

GitHub Actions / python-lint

Ruff (F401)

pycroft/lib/finance/retransfer.py:10:27: F401 `pycroft.model.session` imported but unused
from pycroft.model.finance import BankAccountActivity


def get_activities_to_return() -> Sequence[BankAccountActivity]:
def get_activities_to_return(session: Session) -> Sequence[BankAccountActivity]:

Check failure on line 14 in pycroft/lib/finance/retransfer.py

View workflow job for this annotation

GitHub Actions / python-lint

Ruff (F811)

pycroft/lib/finance/retransfer.py:14:30: F811 Redefinition of unused `session` from line 10
statement = (
select(BankAccountActivity)
.options(joinedload(BankAccountActivity.bank_account))
Expand All @@ -20,7 +20,7 @@ def get_activities_to_return() -> Sequence[BankAccountActivity]:
.filter(BankAccountActivity.imported_at < ensure_tz(datetime.utcnow() - timedelta(days=14)))
)

return session.session.scalars(statement).all()
return session.scalars(statement).all()


def generate_activities_return_sepaxml(activities: list[BankAccountActivity]) -> bytes:
Expand Down
5 changes: 0 additions & 5 deletions web/templates/finance/bank_account_activities_return.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{#
SPDX-FileCopyrightText: 2024 Gregor Düster <git@gdstr.eu>

SPDX-License-Identifier: Apache-2.0
#}
{% extends "layout.html" %}

{% set page_title = "Unzuordenbare Überweisungen zurücküberweisen" %}
Expand Down

0 comments on commit 5889b71

Please sign in to comment.