-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sponsorship: allow admins to temporarily unlock finalized sponsorship…
…s for editing (#2249)
- Loading branch information
Showing
7 changed files
with
150 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Generated by Django 2.2.24 on 2023-02-16 13:55 | ||
|
||
from django.db import migrations, models | ||
|
||
from sponsors.models.sponsorship import Sponsorship as _Sponsorship | ||
|
||
def forwards_func(apps, schema_editor): | ||
Sponsorship = apps.get_model('sponsors', 'Sponsorship') | ||
db_alias = schema_editor.connection.alias | ||
|
||
for sponsorship in Sponsorship.objects.all(): | ||
sponsorship.locked = not (sponsorship.status == _Sponsorship.APPLIED) | ||
sponsorship.save() | ||
|
||
def reverse_func(apps, schema_editor): | ||
pass | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('sponsors', '0093_auto_20230214_2113'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='sponsorship', | ||
name='locked', | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.RunPython(forwards_func, reverse_func) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{% extends 'admin/base_site.html' %} | ||
{% load i18n static sponsors %} | ||
|
||
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">{% endblock %} | ||
|
||
{% block title %}Unlock Finalized Sponsorship {{ sponsorship }} | python.org{% endblock %} | ||
|
||
{% block breadcrumbs %} | ||
<div class="breadcrumbs"> | ||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> > | ||
<a href="{% url 'admin:app_list' app_label='sponsors' %}">{% trans 'Sponsors' %}</a> > | ||
<a href="{% url 'admin:sponsors_sponsorship_changelist' %}">{% trans 'Sponsorship' %}</a> > | ||
<a href="{% url 'admin:sponsors_sponsorship_change' sponsorship.pk %}">{{ sponsorship }}</a> > | ||
{% trans 'Unlock Finalized Sponsorship' %} | ||
</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<h1>Unlock Finalized Sponsorship</h1> | ||
<p>Please review the sponsorship application and click in the Unlock button if you want to proceed.</p> | ||
<div id="content-main"> | ||
<form action="" method="post" id="new_psf_board_meeting_form"> | ||
{% csrf_token %} | ||
|
||
<pre>{% full_sponsorship sponsorship display_fee=True %}</pre> | ||
|
||
<input name="confirm" value="yes" style="display:none"> | ||
|
||
<div class="submit-row"> | ||
<input type="submit" value="Unlock" class="default"> | ||
</div> | ||
|
||
</form> | ||
<div> | ||
</div>{% endblock %} |