aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--notice/models.py3
-rw-r--r--notice/templates/notice/list_notice.html2
2 files changed, 2 insertions, 3 deletions
diff --git a/notice/models.py b/notice/models.py
index 5fafeb5..02780ec 100644
--- a/notice/models.py
+++ b/notice/models.py
@@ -14,7 +14,6 @@ class Notice(models.Model):
title = models.CharField(_("Title"), max_length=100)
pubtime = models.DateTimeField(_("Publish time"), auto_now_add=True)
category = models.ForeignKey('NoticeCategory', verbose_name=_("Category"))
- publisher = models.ForeignKey(User, verbose_name=_("Publisher"))
is_important = models.BooleanField(_("Is important"), default=False)
contents = models.TextField(_("Contents"))
# NoticeAttachment to deal with attachments
@@ -50,7 +49,7 @@ class NoticeCategory(models.Model):
class NoticeAttachment(models.Model):
title = models.CharField(_("Title"), max_length=100)
- description = models.TextField(_("Description"))
+ description = models.TextField(_("Description"), blank=True)
attachment = models.FileField(upload_to='notice/attachments',
verbose_name=_("Attachment"))
content_type = models.ForeignKey(ContentType)
diff --git a/notice/templates/notice/list_notice.html b/notice/templates/notice/list_notice.html
index 2a2703b..14355f0 100644
--- a/notice/templates/notice/list_notice.html
+++ b/notice/templates/notice/list_notice.html
@@ -26,7 +26,7 @@
<div class="notice-content">
{{ notice.contents }}
</div>
- {% if notice.attachments %}
+ {% if notice.attachments.all %}
<div class="notice-attachment">
<ul class="list-unstyled">
{% for attachment in notice.attachments.all %}