diff --git a/boards/migrations/0013_auto_20150408_1210.py b/boards/migrations/0013_auto_20150408_1210.py new file mode 100644 --- /dev/null +++ b/boards/migrations/0013_auto_20150408_1210.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('boards', '0012_thread_max_posts'), + ] + + operations = [ + migrations.RemoveField( + model_name='post', + name='poster_user_agent', + ), + migrations.AlterField( + model_name='post', + name='title', + field=models.CharField(null=True, blank=True, max_length=200), + preserve_default=True, + ), + migrations.AlterField( + model_name='thread', + name='max_posts', + field=models.IntegerField(default=12), + preserve_default=True, + ), + ] diff --git a/boards/models/post.py b/boards/models/post.py --- a/boards/models/post.py +++ b/boards/models/post.py @@ -38,9 +38,6 @@ TITLE_MAX_LENGTH = 200 # TODO This should be removed NO_IP = '0.0.0.0' -# TODO Real user agent should be saved instead of this -UNKNOWN_UA = '' - REGEX_REPLY = re.compile(r'\[post\](\d+)\[/post\]') REGEX_NOTIFICATION = re.compile(r'\[user\](\w+)\[/user\]') @@ -89,8 +86,6 @@ class PostManager(models.Manager): pub_time=posting_time, poster_ip=ip, thread=thread, - poster_user_agent=UNKNOWN_UA, # TODO Get UA at - # last! last_edit_time=posting_time) post.threads.add(thread) @@ -158,7 +153,7 @@ class Post(models.Model, Viewable): app_label = APP_LABEL_BOARDS ordering = ('id',) - title = models.CharField(max_length=TITLE_MAX_LENGTH) + title = models.CharField(max_length=TITLE_MAX_LENGTH, null=True, blank=True) pub_time = models.DateTimeField() text = TextField(blank=True, null=True) _text_rendered = TextField(blank=True, null=True, editable=False) @@ -167,7 +162,6 @@ class Post(models.Model, Viewable): related_name='ip+', db_index=True) poster_ip = models.GenericIPAddressField() - poster_user_agent = models.TextField() last_edit_time = models.DateTimeField()