Skip to content

Commit

Permalink
Remove behavior-changing parameter allow_existing
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasjuhrich committed Sep 4, 2024
1 parent 2b07ce9 commit 6d6cfe3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pycroft/lib/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,6 @@ def check_new_user_data(
room: Room | None,
move_in_date: date | None,
ignore_similar_name: bool = False,
allow_existing: bool = False,
) -> None:
if room is not None and not ignore_similar_name:
check_similar_user_in_room(name, room)
Expand All @@ -1239,9 +1238,6 @@ def check_new_user_data(
if not utcnow.date() <= move_in_date <= (utcnow + timedelta(days=180)).date():
raise MoveInDateInvalidException

if not allow_existing:
check_new_user_data_unused(login=login, email=email, swdd_person_id=swdd_person_id)


def check_new_user_data_unused(login: str, email: str, swdd_person_id: int) -> None:
"""Check whether some user data from a member request is already used.
Expand Down Expand Up @@ -1283,8 +1279,9 @@ def create_member_request(
swdd_person_id,
room,
move_in_date,
allow_existing=previous_dorm is not None,
)
if previous_dorm is None:
check_new_user_data_unused(login=login, email=email, swdd_person_id=swdd_person_id)

if swdd_person_id is not None and room is not None:
tenancies = get_relevant_tenancies(swdd_person_id)
Expand Down

0 comments on commit 6d6cfe3

Please sign in to comment.