Skip to content

Commit

Permalink
Fixed a couple of bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
paltman committed Nov 1, 2012
1 parent 6162e58 commit 829519e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dialogos/authorization.py
Expand Up @@ -21,7 +21,7 @@ def load_path_attr(path):


def default_can_delete(user, comment):
if user.is_superuser():
if user.is_superuser:
return True
return user == comment.author

Expand Down
4 changes: 2 additions & 2 deletions dialogos/forms.py
Expand Up @@ -18,7 +18,7 @@ def __init__(self, *args, **kwargs):
self.obj = kwargs.pop("obj")
self.user = kwargs.pop("user")
super(CommentForm, self).__init__(*args, **kwargs)
if self.user is not None:
if self.user is not None and not self.user.is_anonymous():
del self.fields["name"]
del self.fields["email"]
del self.fields["website"]
Expand All @@ -28,7 +28,7 @@ def save(self, commit=True):
comment.ip_address = self.request.META.get("REMOTE_ADDR", None)
comment.content_type = ContentType.objects.get_for_model(self.obj)
comment.object_id = self.obj.pk
if self.user is not None:
if self.user is not None and not self.user.is_anonymous():
comment.author = self.user
if commit:
comment.save()
Expand Down
3 changes: 0 additions & 3 deletions requirements/development.txt

This file was deleted.

0 comments on commit 829519e

Please sign in to comment.