diff options
author | Weitian LI <liweitianux@gmail.com> | 2014-04-29 01:27:31 +0800 |
---|---|---|
committer | Weitian LI <liweitianux@gmail.com> | 2014-04-29 01:29:51 +0800 |
commit | 9177e7f60868a34a50da65d5dc7fe2aac17b2804 (patch) | |
tree | 252c31625424b220c2794d5f51b50f48ad158b5a | |
parent | 73d343c35f8bd7f405ef642cecace834c4b6c65c (diff) | |
download | django-skaschool-9177e7f60868a34a50da65d5dc7fe2aac17b2804.tar.bz2 |
* updated transcript help_text of account/models.py
* updated ValidationError message and used named string of account/extra.py
* small changes to 'profile.html' and 'profile_update.html'
* added class Meta to notice/models.py/NoticeAttachment
-rw-r--r-- | account/extra.py | 4 | ||||
-rw-r--r-- | account/models.py | 2 | ||||
-rw-r--r-- | account/templates/account/profile.html | 1 | ||||
-rw-r--r-- | account/templates/account/profile_update.html | 1 | ||||
-rw-r--r-- | notice/models.py | 4 |
5 files changed, 9 insertions, 3 deletions
diff --git a/account/extra.py b/account/extra.py index e478c6d..74c11e7 100644 --- a/account/extra.py +++ b/account/extra.py @@ -46,9 +46,9 @@ class ContentTypeRestrictedFileField(models.FileField): #raise forms.ValidationError(_("Invalid filetype."), code='invalid') if content_type in self.content_types: if file._size > self.max_upload_size: - raise forms.ValidationError(_('Please keep filesize under %s. Current filesize %s') % (filesizeformat(self.max_upload_size), filesizeformat(file._size)), code='invalid') + raise forms.ValidationError(_('Please keep filesize under %(maxsize)s. Current filesize %(filesize)s') % {'maxsize':filesizeformat(self.max_upload_size), 'filesize':filesizeformat(file._size)}, code='invalid') else: - raise forms.ValidationError(_("Invalid filetype."), code='invalid') + raise forms.ValidationError(_("Unsupported filetype"), code='invalid') except AttributeError: pass # diff --git a/account/models.py b/account/models.py index 1816c62..87ae0b5 100644 --- a/account/models.py +++ b/account/models.py @@ -72,7 +72,7 @@ class UserProfile(models.Model): # transcript: needed if undergraudate (junior and below) transcript = ContentTypeRestrictedFileField(upload_to=lambda instance, filename: u'account/{0}/{1}'.format(instance.user.username, filename), verbose_name=_("Transcript"), blank=True, null=True, - help_text=_("Undergraduate (junior and below) required to upload transcript."), + help_text=_("Undergraduate (junior and below) required to upload transcript. PDF format is recommended."), storage=OverwriteStorage(), content_types=settings.ALLOWED_CONTENT_TYPES, max_upload_size=settings.ALLOWED_MAX_UPLOAD_SIZE) diff --git a/account/templates/account/profile.html b/account/templates/account/profile.html index a615db5..0eb70d2 100644 --- a/account/templates/account/profile.html +++ b/account/templates/account/profile.html @@ -125,6 +125,7 @@ <a href="{% url 'profile_update' %}" class="btn btn-default">更新个人信息</a> <a href="{% url 'password_change' %}" class="btn btn-default">修改密码</a> </p> + <br> </div> {% endblock %} diff --git a/account/templates/account/profile_update.html b/account/templates/account/profile_update.html index 2023aa9..608f581 100644 --- a/account/templates/account/profile_update.html +++ b/account/templates/account/profile_update.html @@ -44,6 +44,7 @@ {% endfor %} {% buttons submit='提交' reset='重置' layout='horizontal' %}{% endbuttons %} </form> + <br> </div> {% endblock %} diff --git a/notice/models.py b/notice/models.py index 02780ec..e2b9533 100644 --- a/notice/models.py +++ b/notice/models.py @@ -56,4 +56,8 @@ class NoticeAttachment(models.Model): object_id = models.PositiveIntegerField() content_object = generic.GenericForeignKey("content_type", "object_id") + class Meta: + verbose_name = _('notice attachment') + verbose_name_plural = _('notice attachments') + |