Permalink
Browse files

small fixes

  • Loading branch information...
1 parent 567bc49 commit 5694df720309e0f140366ee66ab1aa81c74ddd30 @ofri committed Sep 19, 2011
Showing with 7 additions and 8 deletions.
  1. +6 −6 src/knesset/accounts/models.py
  2. +0 −1 src/knesset/committees/models.py
  3. +1 −1 src/knesset/committees/tests.py
@@ -32,9 +32,9 @@ def send(self,user):
{ 'site': current_site })
# Email subject *must not* contain newlines
subject = ''.join(subject.splitlines())
-
+
message = render_to_string('accounts/email_validation.html',
- { 'activation_key': ev.activation_key,
+ { 'activation_key': ev.activation_key,
'site': current_site })
try:
send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [ev.email])
@@ -69,11 +69,11 @@ def validate(self, user, key):
g = Group.objects.get(name='Valid Email')
except Group.DoesNotExist:
logger.warn('Did not find "Valid Email" group. creating')
- g = Group.objects.create(name='Valid Email')
+ g = Group.objects.create(name='Valid Email')
g.permissions.add(Permission.objects.get(name='Can add comment'))
g.permissions.add(Permission.objects.get(name='Can add annotation'))
- g.permissions.add(Permission.objects.get(name='Can add topic'))
-
+ g.permissions.add(Permission.objects.get(name='Can add Topic'))
+
ev.user.groups.add(g)
ev.activation_key = ''
ev.save()
@@ -84,4 +84,4 @@ def validate(self, user, key):
exceptionType, exceptionValue, exceptionTraceback = sys.exc_info()
logger.error("%s", ''.join(traceback.format_exception(exceptionType, exceptionValue, exceptionTraceback)))
return (False, "Something went wrong.")
-
+
@@ -258,7 +258,6 @@ class Topic(models.Model):
log = models.TextField(default="", blank=True)
class Meta:
- ordering = ('-modified',)
verbose_name = _('Topic')
verbose_name_plural = _('Topics')
@models.permalink
@@ -214,7 +214,7 @@ def setUp(self):
(self.group, created) = Group.objects.get_or_create(name='Valid Email')
if created:
self.group.save()
- self.group.permissions.add(Permission.objects.get(name='Can add topic'))
+ self.group.permissions.add(Permission.objects.get(name='Can add Topic'))
self.jacob.groups.add(self.group)
self.mk_1 = Member.objects.create(name='mk 1')
self.topic = self.committee_1.topic_set.create(creator=self.jacob,

0 comments on commit 5694df7

Please sign in to comment.