Skip to content

Commit

Permalink
strip html tags in nickname save field
Browse files Browse the repository at this point in the history
  • Loading branch information
mihneadb committed Mar 28, 2013
1 parent fe6b68b commit 7664cbc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wouso/interface/profile/views.py
Expand Up @@ -7,6 +7,7 @@
from django.http import Http404, HttpResponse, HttpResponseBadRequest
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template import RequestContext
from django.utils.html import strip_tags
from wouso.core.god import God
from wouso.core.user.models import Player, PlayerGroup, Race
from wouso.core.scoring.models import History
Expand Down Expand Up @@ -34,7 +35,7 @@ class Meta:
def clean_nickname(self):
if Player.objects.exclude(id=self.instance.id).filter(nickname=self.cleaned_data['nickname']).count():
raise ValidationError("Nickname is used")
self.cleaned_data['nickname'] = self.cleaned_data['nickname'].strip().replace(' ', '_')
self.cleaned_data['nickname'] = strip_tags(self.cleaned_data['nickname'].strip().replace(' ', '_'))
return self.cleaned_data['nickname']


Expand Down

0 comments on commit 7664cbc

Please sign in to comment.