diff --git a/.gitignore b/.gitignore index 4a6690c..71f00c5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,7 @@ __pycache__ .viminfo ttadmin/settings_live.py ttadmin/static +venv/ +build/ +dist/ + diff --git a/ttadmin/help/admin.py b/ttadmin/help/admin.py index 61cd79b..e29cc6b 100644 --- a/ttadmin/help/admin.py +++ b/ttadmin/help/admin.py @@ -3,5 +3,7 @@ from .models import Ticket @admin.register(Ticket) class TicketAdmin(admin.ModelAdmin): - list_display = ('issue_status', 'issue_type', 'name', 'email') - fields = ('name', 'email', 'issue_status', 'issue_type', 'issue_text') + readonly_fields = ('submitted',) + list_display = ('submitted', 'issue_status', 'issue_type', 'name', 'email') + list_filter = ('issue_status', 'issue_type') + fields = ('submitted', 'name', 'email', 'issue_status', 'issue_type', 'issue_text') diff --git a/ttadmin/help/migrations/0004_ticket_submitted.py b/ttadmin/help/migrations/0004_ticket_submitted.py new file mode 100644 index 0000000..f8b95c8 --- /dev/null +++ b/ttadmin/help/migrations/0004_ticket_submitted.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.2 on 2019-01-19 18:28 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('help', '0003_auto_20171110_2323'), + ] + + operations = [ + migrations.AddField( + model_name='ticket', + name='submitted', + field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now), + preserve_default=False, + ), + ] diff --git a/ttadmin/help/models.py b/ttadmin/help/models.py index 06962e8..17df9b5 100644 --- a/ttadmin/help/models.py +++ b/ttadmin/help/models.py @@ -1,4 +1,4 @@ -from django.db.models import Model, TextField, EmailField, CharField +from django.db.models import Model, TextField, EmailField, CharField, DateTimeField ISSUE_TYPE_CHOICES = ( ('logging_in', 'help logging in'), @@ -18,6 +18,7 @@ ISSUE_STATUS_CHOICES = ( class Ticket(Model): + submitted = DateTimeField(auto_now_add=True) name = CharField(blank=False, null=False, max_length=100) email = EmailField(blank=False, null=False) issue_type = CharField(choices=ISSUE_TYPE_CHOICES, diff --git a/ttadmin/users/migrations/0010_auto_20190119_1828.py b/ttadmin/users/migrations/0010_auto_20190119_1828.py new file mode 100644 index 0000000..7563409 --- /dev/null +++ b/ttadmin/users/migrations/0010_auto_20190119_1828.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.2 on 2019-01-19 18:28 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0009_auto_20170114_0757'), + ] + + operations = [ + migrations.AlterField( + model_name='pubkey', + name='key_type', + field=models.CharField(choices=[('ssh-rsa', 'ssh-rsa'), ('ssh-dss', 'ssh-dss'), ('ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp256')], max_length=50), + ), + ]