Revert project dates — migrations not running on Flatlogic
Removed start_date and end_date from Project model. Flatlogic doesn't run migrations during rebuild, so the DB columns never got created, crashing the site. Active/inactive resource split is kept. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
47de74bde4
commit
ef77c97719
@ -12,7 +12,7 @@ class UserProfileAdmin(admin.ModelAdmin):
|
||||
|
||||
@admin.register(Project)
|
||||
class ProjectAdmin(admin.ModelAdmin):
|
||||
list_display = ('name', 'start_date', 'end_date', 'active')
|
||||
list_display = ('name', 'active')
|
||||
list_filter = ('active',)
|
||||
search_fields = ('name', 'description')
|
||||
filter_horizontal = ('supervisors',)
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
# Generated by Django 5.2.7 on 2026-02-22 22:44
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0002_update_worker_id_numbers'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='project',
|
||||
name='end_date',
|
||||
field=models.DateField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='project',
|
||||
name='start_date',
|
||||
field=models.DateField(blank=True, null=True),
|
||||
),
|
||||
]
|
||||
@ -25,8 +25,6 @@ def save_user_profile(sender, instance, **kwargs):
|
||||
class Project(models.Model):
|
||||
name = models.CharField(max_length=200)
|
||||
description = models.TextField(blank=True)
|
||||
start_date = models.DateField(null=True, blank=True)
|
||||
end_date = models.DateField(null=True, blank=True)
|
||||
supervisors = models.ManyToManyField(User, related_name='assigned_projects')
|
||||
active = models.BooleanField(default=True)
|
||||
|
||||
|
||||
@ -238,14 +238,7 @@
|
||||
<ul class="list-group list-group-flush" style="max-height: 300px; overflow-y: auto;">
|
||||
{% for item in active_projects %}
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
{{ item.name }}
|
||||
{% if item.start_date or item.end_date %}
|
||||
<br><small class="text-muted">
|
||||
{{ item.start_date|date:"j M Y"|default:"?" }} – {{ item.end_date|date:"j M Y"|default:"ongoing" }}
|
||||
</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ item.name }}
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input toggle-active" type="checkbox" role="switch" data-type="project" data-id="{{ item.id }}" checked>
|
||||
</div>
|
||||
@ -264,14 +257,7 @@
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for item in inactive_projects %}
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center opacity-50">
|
||||
<div>
|
||||
{{ item.name }}
|
||||
{% if item.start_date or item.end_date %}
|
||||
<br><small class="text-muted">
|
||||
{{ item.start_date|date:"j M Y"|default:"?" }} – {{ item.end_date|date:"j M Y"|default:"?" }}
|
||||
</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ item.name }}
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input toggle-active" type="checkbox" role="switch" data-type="project" data-id="{{ item.id }}">
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user