stash
All checks were successful
/ test (push) Successful in 54s

This commit is contained in:
j3d1 2024-11-23 01:35:05 +01:00
parent 63e3319f0d
commit 4f93a36546
8 changed files with 8 additions and 110 deletions

View file

@ -56,6 +56,7 @@ TELEGRAM_GROUP_CHAT_ID = os.getenv('TELEGRAM_GROUP_CHAT_ID', '-1234567890')
# Application definition # Application definition
INSTALLED_APPS = [ INSTALLED_APPS = [
*(['daphne'] if 'runserver' in sys.argv else []),
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
@ -129,7 +130,7 @@ TEMPLATES = [
}, },
] ]
WSGI_APPLICATION = 'core.wsgi.application' ASGI_APPLICATION = 'core.asgi.application'
# Database # Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases # https://docs.djangoproject.com/en/4.2/ref/settings/#databases

View file

@ -1,32 +0,0 @@
# Generated by Django 4.2.7 on 2024-11-20 01:48
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('inventory', '0006_alter_event_table'),
]
operations = [
migrations.RemoveField(
model_name='item',
name='container',
),
migrations.AlterField(
model_name='item',
name='event',
field=models.ForeignKey(db_column='eid', on_delete=django.db.models.deletion.CASCADE, to='inventory.event'),
),
migrations.CreateModel(
name='ItemPlacement',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('timestamp', models.DateTimeField(auto_now_add=True)),
('container', models.ForeignKey(db_column='cid', on_delete=django.db.models.deletion.CASCADE, related_name='item_history', to='inventory.container')),
('item', models.ForeignKey(db_column='iid', on_delete=django.db.models.deletion.CASCADE, related_name='container_history', to='inventory.item')),
],
),
]

View file

@ -1,29 +0,0 @@
# Generated by Django 4.2.7 on 2024-11-20 01:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('inventory', '0007_remove_item_container_alter_item_event_itemplacement'),
]
operations = [
migrations.AlterField(
model_name='item',
name='event',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.event'),
),
migrations.AlterField(
model_name='itemplacement',
name='container',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='item_history', to='inventory.container'),
),
migrations.AlterField(
model_name='itemplacement',
name='item',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='container_history', to='inventory.item'),
),
]

View file

@ -1,23 +0,0 @@
# Generated by Django 4.2.7 on 2024-11-22 22:02
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('inventory', '0008_alter_item_event_alter_itemplacement_container_and_more'),
]
operations = [
migrations.CreateModel(
name='Comment',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('comment', models.TextField()),
('timestamp', models.DateTimeField(auto_now_add=True)),
('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='inventory.item')),
],
),
]

View file

@ -71,7 +71,7 @@ def make_reply(reply_email, references=None, event=None):
reply["From"] = reply_email.sender reply["From"] = reply_email.sender
reply["To"] = reply_email.recipient reply["To"] = reply_email.recipient
reply["Subject"] = reply_email.subject reply["Subject"] = reply_email.subject
reply["Reply-To"] = f"{event}@{MAIL_DOMAIN}" reply["Reply-To"] = f"{event.lower()}@{MAIL_DOMAIN}"
if reply_email.in_reply_to: if reply_email.in_reply_to:
reply["In-Reply-To"] = reply_email.in_reply_to reply["In-Reply-To"] = reply_email.in_reply_to
if reply_email.reference: if reply_email.reference:

View file

@ -21,7 +21,8 @@ from tickets.shared_serializers import RelationSerializer
class IssueViewSet(viewsets.ModelViewSet): class IssueViewSet(viewsets.ModelViewSet):
serializer_class = IssueSerializer serializer_class = IssueSerializer
queryset = IssueThread.objects.all().prefetch_related('state_changes', 'comments', 'emails', 'emails__attachments', 'assignments', 'item_relation_changes', 'shipping_vouchers') queryset = IssueThread.objects.all().prefetch_related('state_changes', 'comments', 'emails', 'emails__attachments',
'assignments', 'item_relation_changes', 'shipping_vouchers')
class RelationViewSet(viewsets.ModelViewSet): class RelationViewSet(viewsets.ModelViewSet):

View file

@ -1,20 +0,0 @@
# Generated by Django 4.2.7 on 2024-11-20 01:48
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('inventory', '0007_remove_item_container_alter_item_event_itemplacement'),
('tickets', '0011_train_old_spam'),
]
operations = [
migrations.AlterField(
model_name='itemrelation',
name='item',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='issue_relations', to='inventory.item'),
),
]

View file

@ -1,4 +1,4 @@
# Generated by Django 4.2.7 on 2024-11-20 23:34 # Generated by Django 4.2.7 on 2024-11-20 23:58
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
@ -7,8 +7,8 @@ import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('inventory', '0008_alter_item_event_alter_itemplacement_container_and_more'), ('inventory', '0006_alter_event_table'),
('tickets', '0012_alter_itemrelation_item'), ('tickets', '0011_train_old_spam'),
] ]
operations = [ operations = [