Zine

open source content publishing system


Changeset 1362:e378a3bb8ea3


Ignore:
Timestamp:
05/15/10 03:04:42 (2 years ago)
Author:
Mike Crute <mcrute@…>
Branch:
default
Parents:
1353:9bae0266ee9d (diff), 1361:ca86c3bc1042 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging polish translation changes for Ticket 237

Location:
zine
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • zine/forms.py

    r1299 r1362  
    913913 
    914914    def context_validate(self, data): 
     915        if self.user.posts.count() is 0: 
     916            data['action'] = None 
    915917        if data['action'] == 'reassign' and not data['reassign_to']: 
    916918            raise ValidationError(_('You have to select a user to reassign ' 
  • zine/forms.py

    r1355 r1362  
    66    The form classes the zine core uses. 
    77 
    8     :copyright: (c) 2009 by the Zine Team, see AUTHORS for more details. 
     8    :copyright: (c) 2010 by the Zine Team, see AUTHORS for more details. 
    99    :license: BSD, see LICENSE for more details. 
    1010""" 
     
    1515from zine.application import get_application, get_request, emit_event 
    1616from zine.config import DEFAULT_VARS 
    17 from zine.database import db, posts, comments, notification_subscriptions 
     17from zine.database import db, posts 
    1818from zine.models import User, Group, Comment, Post, Category, Tag, \ 
    1919     NotificationSubscription, STATUS_DRAFT, STATUS_PUBLISHED, \ 
     
    2828from zine.utils.http import redirect_to 
    2929from zine.utils.validators import ValidationError, is_valid_email, \ 
    30      is_valid_url, is_valid_slug, is_netaddr, is_not_whitespace_only 
     30     is_valid_url, is_valid_slug, is_not_whitespace_only 
    3131from zine.utils.redirects import register_redirect, change_url_prefix 
    3232 
     
    109109    )]) 
    110110    body = forms.TextField(lazy_gettext(u'Text'), min_length=2, max_length=6000, 
    111                            messages=dict( 
     111                           required=True, messages=dict( 
    112112        too_short=lazy_gettext(u'Your comment is too short.'), 
    113113        too_long=lazy_gettext(u'Your comment is too long.'), 
     
    140140        if not self.post.comments_enabled: 
    141141            raise ValidationError(_('Post is closed for commenting.')) 
     142        if self.post.comments_closed: 
     143            raise ValidationError(_('Commenting is no longer possible.')) 
    142144 
    143145    def make_comment(self): 
     
    541543        self.comment.bocked_msg = msg 
    542544 
     545 
    543546class MarkCommentForm(_CommentBoundForm): 
    544547    """Form used to block comments.""" 
     
    913916            data['action'] = None 
    914917        if data['action'] == 'reassign' and not data['reassign_to']: 
    915             # XXX: Bad wording 
    916             raise ValidationError(_('You have to select the user that ' 
    917                                     'gets the posts assigned.')) 
     918            raise ValidationError(_('You have to select a user to reassign ' 
     919                                    'the posts to.')) 
    918920 
    919921    def delete_user(self): 
     
    10041006    """Used for a user to delete a his own account.""" 
    10051007 
     1008    password = forms.TextField( 
     1009        lazy_gettext(u"Your password is required to delete your account:"), 
     1010        required=True, widget=forms.PasswordInput, 
     1011        messages = dict(required=lazy_gettext(u'Your password is required!')) 
     1012    ) 
     1013 
    10061014    def __init__(self, user, initial=None): 
    10071015        _UserBoundForm.__init__(self, user, forms.fill_dict(initial, 
    10081016            action='delete' 
    10091017        )) 
     1018 
     1019    def validate_password(self, value): 
     1020        if not self.user.check_password(value): 
     1021            raise ValidationError(_(u'Invalid password')) 
    10101022 
    10111023    def delete_user(self): 
     
    10671079                                     lazy_gettext(u'Comment Moderation'), 
    10681080                                     widget=forms.RadioButtonGroup) 
     1081    comments_open_for = config_field('comments_open_for', 
     1082        label=lazy_gettext(u'Comments Open Period')) 
    10691083    pings_enabled = config_field('pings_enabled', 
    10701084        lazy_gettext(u'Pingbacks enabled'), 
     
    12081222            else: 
    12091223                parent = None 
    1210     # One could probably optimize this by tracking the amount of deleted 
    1211     # comments 
     1224    # XXX: one could probably optimize this by tracking the amount 
     1225    # of deleted comments 
    12121226    comment.post.sync_comment_count() 
    12131227 
  • zine/utils/mail.py

    r1359 r1362  
    55    This module implements some email-related functions and classes. 
    66 
    7     :copyright: (c) 2009 by the Zine Team, see AUTHORS for more details. 
     7    :copyright: (c) 2010 by the Zine Team, see AUTHORS for more details. 
    88    :license: BSD, see LICENSE for more details. 
    99""" 
     
    1717from urlparse import urlparse 
    1818 
    19 from zine.utils import local 
    2019from zine.utils.validators import is_valid_email, check 
    2120 
  • zine/websetup/__init__.py

    r1279 r1362  
    149149        error = None 
    150150        database_uri = value('database_uri', '').strip() 
     151         
     152        # set up the initial config 
     153        config_filename = path.join(self.instance_folder, 'zine.ini') 
     154        cfg = Configuration(config_filename) 
     155        t = cfg.edit() 
     156        t.update( 
     157            maintenance_mode=environment.MODE != 'development', 
     158            blog_url=request.url_root, 
     159            secret_key=gen_secret_key(), 
     160            database_uri=database_uri, 
     161            language=request.translations.language, 
     162            iid=new_iid(), 
     163            # load one plugin by default for a better theme 
     164            plugins='vessel_theme', 
     165            theme='vessel' 
     166        ) 
     167        cfg._comments['[zine]'] = CONFIG_HEADER 
     168        try: 
     169            t.commit() 
     170        except ConfigurationTransactionError: 
     171            _ = request.translations.gettext 
     172            error = _('The configuration file (%s) could not be opened ' 
     173                      'for writing. Please adjust your permissions and ' 
     174                      'try again.') % config_filename 
     175            return render_response(request, 'error.html', { 
     176            'finished': False, 
     177            'error':    error 
     178            }) 
    151179 
    152180        try: 
     
    183211            ) 
    184212 
    185             # set up the initial config 
    186             config_filename = path.join(self.instance_folder, 'zine.ini') 
    187             cfg = Configuration(config_filename) 
    188             t = cfg.edit() 
    189             t.update( 
    190                 maintenance_mode=environment.MODE != 'development', 
    191                 blog_url=request.url_root, 
    192                 secret_key=gen_secret_key(), 
    193                 database_uri=database_uri, 
    194                 language=request.translations.language, 
    195                 iid=new_iid(), 
    196                 # load one plugin by default for a better theme 
    197                 plugins='vessel_theme', 
    198                 theme='vessel' 
    199             ) 
    200             cfg._comments['[zine]'] = CONFIG_HEADER 
    201             try: 
    202                 t.commit() 
    203             except ConfigurationTransactionError: 
    204                 _ = request.translations.gettext 
    205                 error = _('The configuration file (%s) could not be opened ' 
    206                           'for writing. Please adjust your permissions and ' 
    207                           'try again.') % config_filename 
    208213 
    209214        # use a local variable, the global render_response could 
  • zine/websetup/__init__.py

    r1354 r1362  
    1212    would already be returned by the normal Zine installation. 
    1313 
    14     :copyright: (c) 2009 by the Zine Team, see AUTHORS for more details. 
     14    :copyright: (c) 2010 by the Zine Team, see AUTHORS for more details. 
    1515    :license: BSD, see LICENSE for more details. 
    1616""" 
     
    2121from zine.api import db 
    2222from zine.config import ConfigurationTransactionError 
    23 from zine.models import User 
    2423from zine.utils.crypto import gen_pwhash, gen_secret_key, new_iid 
    2524from zine.utils.validators import is_valid_email, check 
     
    8382 
    8483    def handle_view(self, request, name, ctx=None): 
    85         handler = self.views[name] 
     84        #handler = self.views[name] 
    8685        ctx = ctx or {} 
    8786        ctx.update({ 
Note: See TracChangeset for help on using the changeset viewer.