Skip to content

Commit

Permalink
Added supplier number field to claimant model, made available to edit…
Browse files Browse the repository at this point in the history
… in admin interface and view in fellow profile
  • Loading branch information
phillybroadbent committed Aug 30, 2024
1 parent fd447eb commit c05c801
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lowfat/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class ClaimantAdmin(ExportMixin, SimpleHistoryAdmin):
"attended_inaugural_meeting",
"attended_collaborations_workshop",
"notes_from_admin",
"supplier_number",
],
},
),
Expand All @@ -161,7 +162,7 @@ class ClaimantAdmin(ExportMixin, SimpleHistoryAdmin):
'affiliation',
'funding',
'funding_notes',
'work_description'
'work_description',
]
list_filter = [
'fellow',
Expand Down
54 changes: 54 additions & 0 deletions lowfat/migrations/0160_alter_claimant_application_year_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Generated by Django 4.2 on 2024-07-18 15:49

import datetime
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('lowfat', '0159_auto_20230824_1428'),
]

operations = [
migrations.AlterField(
model_name='claimant',
name='application_year',
field=models.IntegerField(default=2024),
),
migrations.AlterField(
model_name='claimant',
name='inauguration_grant_expiration',
field=models.DateField(default=datetime.date(2026, 3, 31)),
),
migrations.AlterField(
model_name='expense',
name='status',
field=models.CharField(choices=[('S', 'Submitted'), ('C', 'Processing'), ('A', 'Approved'), ('R', 'Rejected'), ('X', 'Removed')], default='S', max_length=1),
),
migrations.AlterField(
model_name='fund',
name='status',
field=models.CharField(choices=[('U', 'Unprocessed'), ('P', 'Processing'), ('A', 'Approved'), ('M', 'Approved by machine'), ('R', 'Rejected'), ('F', 'Archived'), ('C', 'Cancelled'), ('X', 'Removed')], default='U', max_length=1),
),
migrations.AlterField(
model_name='historicalclaimant',
name='application_year',
field=models.IntegerField(default=2024),
),
migrations.AlterField(
model_name='historicalclaimant',
name='inauguration_grant_expiration',
field=models.DateField(default=datetime.date(2026, 3, 31)),
),
migrations.AlterField(
model_name='historicalexpense',
name='status',
field=models.CharField(choices=[('S', 'Submitted'), ('C', 'Processing'), ('A', 'Approved'), ('R', 'Rejected'), ('X', 'Removed')], default='S', max_length=1),
),
migrations.AlterField(
model_name='historicalfund',
name='status',
field=models.CharField(choices=[('U', 'Unprocessed'), ('P', 'Processing'), ('A', 'Approved'), ('M', 'Approved by machine'), ('R', 'Rejected'), ('F', 'Archived'), ('C', 'Cancelled'), ('X', 'Removed')], default='U', max_length=1),
),
]
23 changes: 23 additions & 0 deletions lowfat/migrations/0161_claimant_supplier_number_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2 on 2024-08-30 15:25

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('lowfat', '0160_alter_claimant_application_year_and_more'),
]

operations = [
migrations.AddField(
model_name='claimant',
name='supplier_number',
field=models.CharField(blank=True, max_length=120),
),
migrations.AddField(
model_name='historicalclaimant',
name='supplier_number',
field=models.CharField(blank=True, max_length=120),
),
]
4 changes: 4 additions & 0 deletions lowfat/models/claimant.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ class Meta:
null=True,
blank=True
)
supplier_number = models.CharField(
max_length=MAX_CHAR_LENGTH,
blank=True
)

# Application
screencast_url = models.CharField(
Expand Down
6 changes: 6 additions & 0 deletions lowfat/templates/lowfat/claimant_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ <h1>
<td>{{ claimant.work_description | markdown | safe }}</td>
</tr>
{% endif %}
{% if user.is_staff or claimant and user == claimant.user %}
<tr>
<th>Supplier Number</th>
<td>{{ claimant.supplier_number | markdown | safe }}</td>
</tr>
{% endif %}
</table>
</div>
</div>
Expand Down

0 comments on commit c05c801

Please sign in to comment.