Changeset 1362:e378a3bb8ea3
- Timestamp:
- 05/15/10 03:04:42 (2 years ago)
- 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. - Location:
- zine
- Files:
-
- 2 deleted
- 5 edited
-
forms.py (modified) (1 diff)
-
forms.py (modified) (10 diffs)
-
shared/admin/img/footerbg.png (deleted)
-
templates/admin/import_blogger.html (deleted)
-
utils/mail.py (modified) (2 diffs)
-
websetup/__init__.py (modified) (2 diffs)
-
websetup/__init__.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
zine/forms.py
r1299 r1362 913 913 914 914 def context_validate(self, data): 915 if self.user.posts.count() is 0: 916 data['action'] = None 915 917 if data['action'] == 'reassign' and not data['reassign_to']: 916 918 raise ValidationError(_('You have to select a user to reassign ' -
zine/forms.py
r1355 r1362 6 6 The form classes the zine core uses. 7 7 8 :copyright: (c) 20 09by the Zine Team, see AUTHORS for more details.8 :copyright: (c) 2010 by the Zine Team, see AUTHORS for more details. 9 9 :license: BSD, see LICENSE for more details. 10 10 """ … … 15 15 from zine.application import get_application, get_request, emit_event 16 16 from zine.config import DEFAULT_VARS 17 from zine.database import db, posts , comments, notification_subscriptions17 from zine.database import db, posts 18 18 from zine.models import User, Group, Comment, Post, Category, Tag, \ 19 19 NotificationSubscription, STATUS_DRAFT, STATUS_PUBLISHED, \ … … 28 28 from zine.utils.http import redirect_to 29 29 from zine.utils.validators import ValidationError, is_valid_email, \ 30 is_valid_url, is_valid_slug, is_n etaddr, is_not_whitespace_only30 is_valid_url, is_valid_slug, is_not_whitespace_only 31 31 from zine.utils.redirects import register_redirect, change_url_prefix 32 32 … … 109 109 )]) 110 110 body = forms.TextField(lazy_gettext(u'Text'), min_length=2, max_length=6000, 111 messages=dict(111 required=True, messages=dict( 112 112 too_short=lazy_gettext(u'Your comment is too short.'), 113 113 too_long=lazy_gettext(u'Your comment is too long.'), … … 140 140 if not self.post.comments_enabled: 141 141 raise ValidationError(_('Post is closed for commenting.')) 142 if self.post.comments_closed: 143 raise ValidationError(_('Commenting is no longer possible.')) 142 144 143 145 def make_comment(self): … … 541 543 self.comment.bocked_msg = msg 542 544 545 543 546 class MarkCommentForm(_CommentBoundForm): 544 547 """Form used to block comments.""" … … 913 916 data['action'] = None 914 917 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.')) 918 920 919 921 def delete_user(self): … … 1004 1006 """Used for a user to delete a his own account.""" 1005 1007 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 1006 1014 def __init__(self, user, initial=None): 1007 1015 _UserBoundForm.__init__(self, user, forms.fill_dict(initial, 1008 1016 action='delete' 1009 1017 )) 1018 1019 def validate_password(self, value): 1020 if not self.user.check_password(value): 1021 raise ValidationError(_(u'Invalid password')) 1010 1022 1011 1023 def delete_user(self): … … 1067 1079 lazy_gettext(u'Comment Moderation'), 1068 1080 widget=forms.RadioButtonGroup) 1081 comments_open_for = config_field('comments_open_for', 1082 label=lazy_gettext(u'Comments Open Period')) 1069 1083 pings_enabled = config_field('pings_enabled', 1070 1084 lazy_gettext(u'Pingbacks enabled'), … … 1208 1222 else: 1209 1223 parent = None 1210 # One could probably optimize this by tracking the amount of deleted1211 # comments1224 # XXX: one could probably optimize this by tracking the amount 1225 # of deleted comments 1212 1226 comment.post.sync_comment_count() 1213 1227 -
zine/utils/mail.py
r1359 r1362 5 5 This module implements some email-related functions and classes. 6 6 7 :copyright: (c) 20 09by the Zine Team, see AUTHORS for more details.7 :copyright: (c) 2010 by the Zine Team, see AUTHORS for more details. 8 8 :license: BSD, see LICENSE for more details. 9 9 """ … … 17 17 from urlparse import urlparse 18 18 19 from zine.utils import local20 19 from zine.utils.validators import is_valid_email, check 21 20 -
zine/websetup/__init__.py
r1279 r1362 149 149 error = None 150 150 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 }) 151 179 152 180 try: … … 183 211 ) 184 212 185 # set up the initial config186 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 theme197 plugins='vessel_theme',198 theme='vessel'199 )200 cfg._comments['[zine]'] = CONFIG_HEADER201 try:202 t.commit()203 except ConfigurationTransactionError:204 _ = request.translations.gettext205 error = _('The configuration file (%s) could not be opened '206 'for writing. Please adjust your permissions and '207 'try again.') % config_filename208 213 209 214 # use a local variable, the global render_response could -
zine/websetup/__init__.py
r1354 r1362 12 12 would already be returned by the normal Zine installation. 13 13 14 :copyright: (c) 20 09by the Zine Team, see AUTHORS for more details.14 :copyright: (c) 2010 by the Zine Team, see AUTHORS for more details. 15 15 :license: BSD, see LICENSE for more details. 16 16 """ … … 21 21 from zine.api import db 22 22 from zine.config import ConfigurationTransactionError 23 from zine.models import User24 23 from zine.utils.crypto import gen_pwhash, gen_secret_key, new_iid 25 24 from zine.utils.validators import is_valid_email, check … … 83 82 84 83 def handle_view(self, request, name, ctx=None): 85 handler = self.views[name]84 #handler = self.views[name] 86 85 ctx = ctx or {} 87 86 ctx.update({
Note: See TracChangeset
for help on using the changeset viewer.