mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
housekeep: TU rename - /tu routes
Change /tu to /package-maintainer Signed-off-by: moson <moson@archlinux.org>
This commit is contained in:
parent
9730122da9
commit
49b7fa37f3
13 changed files with 68 additions and 62 deletions
|
@ -52,7 +52,7 @@ def populate_package_maintainer_counts(context: dict[str, Any]) -> None:
|
|||
context["active_package_maintainer_count"] = active_pm_query.count()
|
||||
|
||||
|
||||
@router.get("/tu")
|
||||
@router.get("/package-maintainer")
|
||||
@requires_auth
|
||||
async def package_maintainer(
|
||||
request: Request,
|
||||
|
@ -141,7 +141,7 @@ async def package_maintainer(
|
|||
"pby": past_by,
|
||||
}
|
||||
|
||||
return render_template(request, "tu/index.html", context)
|
||||
return render_template(request, "package-maintainer/index.html", context)
|
||||
|
||||
|
||||
def render_proposal(
|
||||
|
@ -176,14 +176,16 @@ def render_proposal(
|
|||
context["vote"] = vote
|
||||
context["has_voted"] = vote is not None
|
||||
|
||||
return render_template(request, "tu/show.html", context, status_code=status_code)
|
||||
return render_template(
|
||||
request, "package-maintainer/show.html", context, status_code=status_code
|
||||
)
|
||||
|
||||
|
||||
@router.get("/tu/{proposal}")
|
||||
@router.get("/package-maintainer/{proposal}")
|
||||
@requires_auth
|
||||
async def package_maintainer_proposal(request: Request, proposal: int):
|
||||
if not request.user.has_credential(creds.PM_LIST_VOTES):
|
||||
return RedirectResponse("/tu", status_code=HTTPStatus.SEE_OTHER)
|
||||
return RedirectResponse("/package-maintainer", status_code=HTTPStatus.SEE_OTHER)
|
||||
|
||||
context = await make_variable_context(request, "Package Maintainer")
|
||||
proposal = int(proposal)
|
||||
|
@ -221,14 +223,14 @@ async def package_maintainer_proposal(request: Request, proposal: int):
|
|||
|
||||
|
||||
@db.async_retry_deadlock
|
||||
@router.post("/tu/{proposal}")
|
||||
@router.post("/package-maintainer/{proposal}")
|
||||
@handle_form_exceptions
|
||||
@requires_auth
|
||||
async def package_maintainer_proposal_post(
|
||||
request: Request, proposal: int, decision: str = Form(...)
|
||||
):
|
||||
if not request.user.has_credential(creds.PM_LIST_VOTES):
|
||||
return RedirectResponse("/tu", status_code=HTTPStatus.SEE_OTHER)
|
||||
return RedirectResponse("/package-maintainer", status_code=HTTPStatus.SEE_OTHER)
|
||||
|
||||
context = await make_variable_context(request, "Package Maintainer")
|
||||
proposal = int(proposal) # Make sure it's an int.
|
||||
|
@ -292,7 +294,7 @@ async def package_maintainer_addvote(
|
|||
request: Request, user: str = str(), type: str = "add_pm", agenda: str = str()
|
||||
):
|
||||
if not request.user.has_credential(creds.PM_ADD_VOTE):
|
||||
return RedirectResponse("/tu", status_code=HTTPStatus.SEE_OTHER)
|
||||
return RedirectResponse("/package-maintainer", status_code=HTTPStatus.SEE_OTHER)
|
||||
|
||||
context = await make_variable_context(request, "Add Proposal")
|
||||
|
||||
|
@ -318,7 +320,7 @@ async def package_maintainer_addvote_post(
|
|||
agenda: str = Form(default=str()),
|
||||
):
|
||||
if not request.user.has_credential(creds.PM_ADD_VOTE):
|
||||
return RedirectResponse("/tu", status_code=HTTPStatus.SEE_OTHER)
|
||||
return RedirectResponse("/package-maintainer", status_code=HTTPStatus.SEE_OTHER)
|
||||
|
||||
# Build a context.
|
||||
context = await make_variable_context(request, "Add Proposal")
|
||||
|
@ -394,5 +396,5 @@ async def package_maintainer_addvote_post(
|
|||
)
|
||||
|
||||
# Redirect to the new proposal.
|
||||
endpoint = f"/tu/{voteinfo.ID}"
|
||||
endpoint = f"/package-maintainer/{voteinfo.ID}"
|
||||
return RedirectResponse(endpoint, status_code=HTTPStatus.SEE_OTHER)
|
||||
|
|
|
@ -780,7 +780,7 @@ class TUVoteReminderNotification(Notification):
|
|||
).format(id=self._vote_id)
|
||||
|
||||
def get_refs(self):
|
||||
return (aur_location + "/tu/?id=" + str(self._vote_id),)
|
||||
return (aur_location + "/package-maintainer/?id=" + str(self._vote_id),)
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
off = current_off,
|
||||
by = current_by
|
||||
%}
|
||||
{% include "partials/tu/proposals.html" %}
|
||||
{% include "partials/package-maintainer/proposals.html" %}
|
||||
{% endwith %}
|
||||
|
||||
{%
|
||||
|
@ -42,10 +42,10 @@
|
|||
off = past_off,
|
||||
by = past_by
|
||||
%}
|
||||
{% include "partials/tu/proposals.html" %}
|
||||
{% include "partials/package-maintainer/proposals.html" %}
|
||||
{% endwith %}
|
||||
|
||||
{% with title = "Last Votes by Package Maintainer", votes = last_votes_by_pm %}
|
||||
{% include "partials/tu/last_votes.html" %}
|
||||
{% include "partials/package-maintainer/last_votes.html" %}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
{% block pageContent %}
|
||||
<div class="box">
|
||||
{% include "partials/tu/proposal/details.html" %}
|
||||
{% include "partials/package-maintainer/proposal/details.html" %}
|
||||
</div>
|
||||
|
||||
{% if utcnow >= voteinfo.End %}
|
||||
<div class="box">
|
||||
{% include "partials/tu/proposal/voters.html" %}
|
||||
{% include "partials/package-maintainer/proposal/voters.html" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
|||
{% if error %}
|
||||
<span class="status">{{ error | tr }}</span>
|
||||
{% else %}
|
||||
{% include "partials/tu/proposal/form.html" %}
|
||||
{% include "partials/package-maintainer/proposal/form.html" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -39,7 +39,7 @@
|
|||
{# Only CRED_PM_LIST_VOTES privileged users see Package Maintainer #}
|
||||
{% if request.user.has_credential(creds.PM_LIST_VOTES) %}
|
||||
<li>
|
||||
<a href="/tu">{% trans %}Package Maintainer{% endtrans %}</a>
|
||||
<a href="/package-maintainer">{% trans %}Package Maintainer{% endtrans %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/tu/{{ vote.LastVote }}">
|
||||
<a href="/package-maintainer/{{ vote.LastVote }}">
|
||||
{{ vote.LastVote }}
|
||||
</a>
|
||||
</td>
|
|
@ -1,4 +1,4 @@
|
|||
<form class="action-form" action="/tu/{{ proposal }}" method="POST">
|
||||
<form class="action-form" action="/package-maintainer/{{ proposal }}" method="POST">
|
||||
<!-- Translate each button's text but leave the value alone. -->
|
||||
<fieldset>
|
||||
<button type="submit" class="button" name="decision" value="Yes">
|
|
@ -44,7 +44,7 @@
|
|||
<td>
|
||||
<!-- Truncate the agenda back to prev_len. -->
|
||||
{% set agenda = result.Agenda[:prev_len] %}
|
||||
<a href="/tu/{{ result.ID }}">{{ agenda }}</a>
|
||||
<a href="/package-maintainer/{{ result.ID }}">{{ agenda }}</a>
|
||||
</td>
|
||||
|
||||
<td>{{ date_display(result.Submitted) }}</td>
|
|
@ -561,7 +561,7 @@ def test_tu_vote_reminders(user: User):
|
|||
Please remember to cast your vote on proposal {vote_id} [1]. The voting period
|
||||
ends in less than 48 hours.
|
||||
|
||||
[1] {aur_location}/tu/?id={vote_id}\
|
||||
[1] {aur_location}/package-maintainer/?id={vote_id}\
|
||||
"""
|
||||
assert email.body == expected
|
||||
|
||||
|
@ -586,7 +586,7 @@ def test_notify_main(user: User):
|
|||
Please remember to cast your vote on proposal {vote_id} [1]. The voting period
|
||||
ends in less than 48 hours.
|
||||
|
||||
[1] {aur_location}/tu/?id={vote_id}\
|
||||
[1] {aur_location}/package-maintainer/?id={vote_id}\
|
||||
"""
|
||||
assert email.body == expected
|
||||
|
||||
|
|
|
@ -155,12 +155,12 @@ def proposal(user, tu_user):
|
|||
|
||||
|
||||
def test_tu_index_guest(client):
|
||||
headers = {"referer": config.get("options", "aur_location") + "/tu"}
|
||||
headers = {"referer": config.get("options", "aur_location") + "/package-maintainer"}
|
||||
with client as request:
|
||||
response = request.get("/tu", headers=headers)
|
||||
response = request.get("/package-maintainer", headers=headers)
|
||||
assert response.status_code == int(HTTPStatus.SEE_OTHER)
|
||||
|
||||
params = filters.urlencode({"next": "/tu"})
|
||||
params = filters.urlencode({"next": "/package-maintainer"})
|
||||
assert response.headers.get("location") == f"/login?{params}"
|
||||
|
||||
|
||||
|
@ -169,7 +169,7 @@ def test_tu_index_unauthorized(client: TestClient, user: User):
|
|||
with client as request:
|
||||
# Login as a normal user, not a TU.
|
||||
request.cookies = cookies
|
||||
response = request.get("/tu")
|
||||
response = request.get("/package-maintainer")
|
||||
assert response.status_code == int(HTTPStatus.SEE_OTHER)
|
||||
assert response.headers.get("location") == "/"
|
||||
|
||||
|
@ -177,11 +177,11 @@ def test_tu_index_unauthorized(client: TestClient, user: User):
|
|||
def test_tu_empty_index(client, tu_user):
|
||||
"""Check an empty index when we don't create any records."""
|
||||
|
||||
# Make a default get request to /tu.
|
||||
# Make a default get request to /package-maintainer.
|
||||
cookies = {"AURSID": tu_user.login(Request(), "testPassword")}
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get("/tu")
|
||||
response = request.get("/package-maintainer")
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
# Parse lxml root.
|
||||
|
@ -232,13 +232,13 @@ def test_tu_index(client, tu_user):
|
|||
# Pass an invalid cby and pby; let them default to "desc".
|
||||
request.cookies = cookies
|
||||
response = request.get(
|
||||
"/tu",
|
||||
"/package-maintainer",
|
||||
params={"cby": "BAD!", "pby": "blah"},
|
||||
)
|
||||
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
# Rows we expect to exist in HTML produced by /tu for current votes.
|
||||
# Rows we expect to exist in HTML produced by /package-maintainer for current votes.
|
||||
expected_rows = [
|
||||
(
|
||||
r"Test agenda 1",
|
||||
|
@ -265,7 +265,7 @@ def test_tu_index(client, tu_user):
|
|||
past_votes = [c for c in votes if c[2] <= ts]
|
||||
assert len(past_votes) == len(expected_rows)
|
||||
|
||||
# Rows we expect to exist in HTML produced by /tu for past votes.
|
||||
# Rows we expect to exist in HTML produced by /package-maintainer for past votes.
|
||||
expected_rows = [
|
||||
(
|
||||
r"Test agenda 2",
|
||||
|
@ -300,7 +300,7 @@ def test_tu_stats(client: TestClient, tu_user: User):
|
|||
cookies = {"AURSID": tu_user.login(Request(), "testPassword")}
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get("/tu")
|
||||
response = request.get("/package-maintainer")
|
||||
assert response.status_code == HTTPStatus.OK
|
||||
|
||||
root = parse_root(response.text)
|
||||
|
@ -322,7 +322,7 @@ def test_tu_stats(client: TestClient, tu_user: User):
|
|||
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get("/tu")
|
||||
response = request.get("/package-maintainer")
|
||||
assert response.status_code == HTTPStatus.OK
|
||||
|
||||
root = parse_root(response.text)
|
||||
|
@ -371,7 +371,7 @@ def test_tu_index_table_paging(client, tu_user):
|
|||
cookies = {"AURSID": tu_user.login(Request(), "testPassword")}
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get("/tu")
|
||||
response = request.get("/package-maintainer")
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
# Parse lxml.etree root.
|
||||
|
@ -402,7 +402,7 @@ def test_tu_index_table_paging(client, tu_user):
|
|||
offset = 10 # Specify coff=10
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get("/tu", params={"coff": offset})
|
||||
response = request.get("package-maintainer", params={"coff": offset})
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
old_rows = rows
|
||||
|
@ -430,7 +430,7 @@ def test_tu_index_table_paging(client, tu_user):
|
|||
offset = 20 # Specify coff=10
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get("/tu", params={"coff": offset})
|
||||
response = request.get("/package-maintainer", params={"coff": offset})
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
# Do it again, we only have five left.
|
||||
|
@ -476,11 +476,11 @@ def test_tu_index_sorting(client, tu_user):
|
|||
# of the tables.
|
||||
ts += 86405
|
||||
|
||||
# Make a default request to /tu.
|
||||
# Make a default request to /package-maintainer.
|
||||
cookies = {"AURSID": tu_user.login(Request(), "testPassword")}
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get("/tu")
|
||||
response = request.get("/package-maintainer")
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
# Get lxml handles of the document.
|
||||
|
@ -508,7 +508,7 @@ def test_tu_index_sorting(client, tu_user):
|
|||
# in ascending order instead of the default descending order.
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get("/tu", params={"cby": "asc"})
|
||||
response = request.get("/package-maintainer", params={"cby": "asc"})
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
# Get lxml handles of the document.
|
||||
|
@ -560,7 +560,7 @@ def test_tu_index_last_votes(
|
|||
cookies = {"AURSID": tu_user.login(Request(), "testPassword")}
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get("/tu")
|
||||
response = request.get("/package-maintainer")
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
root = parse_root(response.text)
|
||||
|
@ -583,7 +583,9 @@ def test_tu_proposal_not_found(client, tu_user):
|
|||
cookies = {"AURSID": tu_user.login(Request(), "testPassword")}
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get("/tu", params={"id": 1}, follow_redirects=True)
|
||||
response = request.get(
|
||||
"/package-maintainer", params={"id": 1}, follow_redirects=True
|
||||
)
|
||||
assert response.status_code == int(HTTPStatus.NOT_FOUND)
|
||||
|
||||
|
||||
|
@ -591,18 +593,18 @@ def test_tu_proposal_unauthorized(
|
|||
client: TestClient, user: User, proposal: Tuple[User, User, TUVoteInfo]
|
||||
):
|
||||
cookies = {"AURSID": user.login(Request(), "testPassword")}
|
||||
endpoint = f"/tu/{proposal[2].ID}"
|
||||
endpoint = f"/package-maintainer/{proposal[2].ID}"
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get(endpoint)
|
||||
assert response.status_code == int(HTTPStatus.SEE_OTHER)
|
||||
assert response.headers.get("location") == "/tu"
|
||||
assert response.headers.get("location") == "/package-maintainer"
|
||||
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.post(endpoint, data={"decision": False})
|
||||
assert response.status_code == int(HTTPStatus.SEE_OTHER)
|
||||
assert response.headers.get("location") == "/tu"
|
||||
assert response.headers.get("location") == "/package-maintainer"
|
||||
|
||||
|
||||
def test_tu_running_proposal(
|
||||
|
@ -612,12 +614,12 @@ def test_tu_running_proposal(
|
|||
with db.begin():
|
||||
voteinfo.ActiveTUs = 1
|
||||
|
||||
# Initiate an authenticated GET request to /tu/{proposal_id}.
|
||||
# Initiate an authenticated GET request to /package-maintainer/{proposal_id}.
|
||||
proposal_id = voteinfo.ID
|
||||
cookies = {"AURSID": tu_user.login(Request(), "testPassword")}
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get(f"/tu/{proposal_id}")
|
||||
response = request.get(f"/package-maintainer/{proposal_id}")
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
# Alright, now let's continue on to verifying some markup.
|
||||
|
@ -688,7 +690,9 @@ def test_tu_running_proposal(
|
|||
# Make another request now that we've voted.
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get("/tu", params={"id": voteinfo.ID}, follow_redirects=True)
|
||||
response = request.get(
|
||||
"/package-maintainer", params={"id": voteinfo.ID}, follow_redirects=True
|
||||
)
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
# Parse our new root.
|
||||
|
@ -710,12 +714,12 @@ def test_tu_ended_proposal(client, proposal):
|
|||
with db.begin():
|
||||
voteinfo.End = ts - 5 # 5 seconds ago.
|
||||
|
||||
# Initiate an authenticated GET request to /tu/{proposal_id}.
|
||||
# Initiate an authenticated GET request to /package-maintainer/{proposal_id}.
|
||||
proposal_id = voteinfo.ID
|
||||
cookies = {"AURSID": tu_user.login(Request(), "testPassword")}
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.get(f"/tu/{proposal_id}")
|
||||
response = request.get(f"/package-maintainer/{proposal_id}")
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
# Alright, now let's continue on to verifying some markup.
|
||||
|
@ -748,7 +752,7 @@ def test_tu_proposal_vote_not_found(client, tu_user):
|
|||
with client as request:
|
||||
data = {"decision": "Yes"}
|
||||
request.cookies = cookies
|
||||
response = request.post("/tu/1", data=data)
|
||||
response = request.post("/package-maintainer/1", data=data)
|
||||
assert response.status_code == int(HTTPStatus.NOT_FOUND)
|
||||
|
||||
|
||||
|
@ -762,7 +766,7 @@ def test_tu_proposal_vote(client, proposal):
|
|||
with client as request:
|
||||
data = {"decision": "Yes"}
|
||||
request.cookies = cookies
|
||||
response = request.post(f"/tu/{voteinfo.ID}", data=data)
|
||||
response = request.post(f"/package-maintainer/{voteinfo.ID}", data=data)
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
# Check that the proposal record got updated.
|
||||
|
@ -791,7 +795,7 @@ def test_tu_proposal_vote_unauthorized(
|
|||
with client as request:
|
||||
data = {"decision": "Yes"}
|
||||
request.cookies = cookies
|
||||
response = request.post(f"/tu/{voteinfo.ID}", data=data)
|
||||
response = request.post(f"package-maintainer/{voteinfo.ID}", data=data)
|
||||
assert response.status_code == int(HTTPStatus.UNAUTHORIZED)
|
||||
|
||||
root = parse_root(response.text)
|
||||
|
@ -801,7 +805,7 @@ def test_tu_proposal_vote_unauthorized(
|
|||
with client as request:
|
||||
data = {"decision": "Yes"}
|
||||
request.cookies = cookies
|
||||
response = request.get(f"/tu/{voteinfo.ID}", params=data)
|
||||
response = request.get(f"/package-maintainer/{voteinfo.ID}", params=data)
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
root = parse_root(response.text)
|
||||
|
@ -820,7 +824,7 @@ def test_tu_proposal_vote_cant_self_vote(client, proposal):
|
|||
with client as request:
|
||||
data = {"decision": "Yes"}
|
||||
request.cookies = cookies
|
||||
response = request.post(f"/tu/{voteinfo.ID}", data=data)
|
||||
response = request.post(f"/package-maintainer/{voteinfo.ID}", data=data)
|
||||
assert response.status_code == int(HTTPStatus.BAD_REQUEST)
|
||||
|
||||
root = parse_root(response.text)
|
||||
|
@ -830,7 +834,7 @@ def test_tu_proposal_vote_cant_self_vote(client, proposal):
|
|||
with client as request:
|
||||
data = {"decision": "Yes"}
|
||||
request.cookies = cookies
|
||||
response = request.get(f"/tu/{voteinfo.ID}", params=data)
|
||||
response = request.get(f"/package-maintainer/{voteinfo.ID}", params=data)
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
root = parse_root(response.text)
|
||||
|
@ -850,7 +854,7 @@ def test_tu_proposal_vote_already_voted(client, proposal):
|
|||
with client as request:
|
||||
data = {"decision": "Yes"}
|
||||
request.cookies = cookies
|
||||
response = request.post(f"/tu/{voteinfo.ID}", data=data)
|
||||
response = request.post(f"/package-maintainer/{voteinfo.ID}", data=data)
|
||||
assert response.status_code == int(HTTPStatus.BAD_REQUEST)
|
||||
|
||||
root = parse_root(response.text)
|
||||
|
@ -860,7 +864,7 @@ def test_tu_proposal_vote_already_voted(client, proposal):
|
|||
with client as request:
|
||||
data = {"decision": "Yes"}
|
||||
request.cookies = cookies
|
||||
response = request.get(f"/tu/{voteinfo.ID}", params=data)
|
||||
response = request.get(f"/package-maintainer/{voteinfo.ID}", params=data)
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
root = parse_root(response.text)
|
||||
|
@ -875,7 +879,7 @@ def test_tu_proposal_vote_invalid_decision(client, proposal):
|
|||
with client as request:
|
||||
data = {"decision": "EVIL"}
|
||||
request.cookies = cookies
|
||||
response = request.post(f"/tu/{voteinfo.ID}", data=data)
|
||||
response = request.post(f"package-maintainer/{voteinfo.ID}", data=data)
|
||||
assert response.status_code == int(HTTPStatus.BAD_REQUEST)
|
||||
assert response.text == "Invalid 'decision' value."
|
||||
|
||||
|
@ -896,13 +900,13 @@ def test_tu_addvote_unauthorized(
|
|||
request.cookies = cookies
|
||||
response = request.get("/addvote")
|
||||
assert response.status_code == int(HTTPStatus.SEE_OTHER)
|
||||
assert response.headers.get("location") == "/tu"
|
||||
assert response.headers.get("location") == "/package-maintainer"
|
||||
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
response = request.post("/addvote")
|
||||
assert response.status_code == int(HTTPStatus.SEE_OTHER)
|
||||
assert response.headers.get("location") == "/tu"
|
||||
assert response.headers.get("location") == "/package-maintainer"
|
||||
|
||||
|
||||
def test_tu_addvote_invalid_type(client: TestClient, tu_user: User):
|
||||
|
|
|
@ -40,7 +40,7 @@ def email_pieces(voteinfo: TUVoteInfo) -> Tuple[str, str]:
|
|||
content = (
|
||||
f"Please remember to cast your vote on proposal {voteinfo.ID} "
|
||||
f"[1]. The voting period\nends in less than 48 hours.\n\n"
|
||||
f"[1] {aur_location}/tu/?id={voteinfo.ID}"
|
||||
f"[1] {aur_location}/package-maintainer/?id={voteinfo.ID}"
|
||||
)
|
||||
return subject, content
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue