diff options
Diffstat (limited to 'account')
-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 |
4 files changed, 5 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 %} |