mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-23 20:06:35 +11:00
Further language cleanup.
This commit is contained in:
parent
dce3d6b9bd
commit
8683c4c30d
5 changed files with 6 additions and 6 deletions
|
@ -61,7 +61,7 @@ behavior without touching the code:
|
||||||
(3600 * 24 * 30 * 12 * 100, ugettext(u'100 Years')),
|
(3600 * 24 * 30 * 12 * 100, ugettext(u'100 Years')),
|
||||||
)
|
)
|
||||||
|
|
||||||
**One-time snippets** are supported. One time snippets are automatically
|
**One-time snippets** are supported. One-Time snippets are automatically
|
||||||
deleted once a defined view count has reached (Default: ``2``). To
|
deleted once a defined view count has reached (Default: ``2``). To
|
||||||
enable one-time snippets you have to add a choice ``onetime`` to the
|
enable one-time snippets you have to add a choice ``onetime`` to the
|
||||||
expire choices::
|
expire choices::
|
||||||
|
|
|
@ -82,7 +82,7 @@ class SnippetForm(forms.ModelForm):
|
||||||
def clean_content(self):
|
def clean_content(self):
|
||||||
content = self.cleaned_data.get('content', '')
|
content = self.cleaned_data.get('content', '')
|
||||||
if content.strip() == '':
|
if content.strip() == '':
|
||||||
raise forms.ValidationError(_('Please fill out this field.'))
|
raise forms.ValidationError(_('This field is required.'))
|
||||||
return content
|
return content
|
||||||
|
|
||||||
def clean_expires(self):
|
def clean_expires(self):
|
||||||
|
|
|
@ -35,7 +35,7 @@ class Snippet(models.Model):
|
||||||
EXPIRE_CHOICES = (
|
EXPIRE_CHOICES = (
|
||||||
(EXPIRE_TIME, _(u'Expire by timestamp')),
|
(EXPIRE_TIME, _(u'Expire by timestamp')),
|
||||||
(EXPIRE_KEEP, _(u'Keep Forever')),
|
(EXPIRE_KEEP, _(u'Keep Forever')),
|
||||||
(EXPIRE_ONETIME, _(u'One time snippet')),
|
(EXPIRE_ONETIME, _(u'One-Time snippet')),
|
||||||
)
|
)
|
||||||
|
|
||||||
secret_id = models.CharField(_(u'Secret ID'), max_length=255, blank=True, null=True,
|
secret_id = models.CharField(_(u'Secret ID'), max_length=255, blank=True, null=True,
|
||||||
|
|
|
@ -81,9 +81,9 @@
|
||||||
<p class="message">
|
<p class="message">
|
||||||
{% trans "This is a one-time snippet." %}
|
{% trans "This is a one-time snippet." %}
|
||||||
{% if snippet.remaining_views > 1 %}
|
{% if snippet.remaining_views > 1 %}
|
||||||
{% trans "It will automatically get deleted after {{ remaining }} further views." %}
|
{% blocktrans with remaining=snippet.remaining_views %}It is automatically removed after {{ remaining }} further views.{% endblocktrans %}
|
||||||
{% elif snippet.remaining_views == 1 %}
|
{% elif snippet.remaining_views == 1 %}
|
||||||
{% trans "It will automatically get deleted after the next view." %}
|
{% trans "It is automatically removed after the next view." %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% trans "It cannot be viewed again." %}
|
{% trans "It cannot be viewed again." %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -67,7 +67,7 @@ def snippet_details(request, snippet_id, template_name='dpaste/snippet_details.h
|
||||||
"""
|
"""
|
||||||
snippet = get_object_or_404(Snippet, secret_id=snippet_id)
|
snippet = get_object_or_404(Snippet, secret_id=snippet_id)
|
||||||
|
|
||||||
# One time snippet get deleted if the view count matches our limit
|
# One-Time snippet get deleted if the view count matches our limit
|
||||||
if snippet.expire_type == Snippet.EXPIRE_ONETIME \
|
if snippet.expire_type == Snippet.EXPIRE_ONETIME \
|
||||||
and snippet.view_count >= ONETIME_LIMIT:
|
and snippet.view_count >= ONETIME_LIMIT:
|
||||||
snippet.delete()
|
snippet.delete()
|
||||||
|
|
Loading…
Reference in a new issue