Added the ability to add notes to user's accounts

This commit is contained in:
2011-12-07 19:29:40 +00:00
parent 5adc4001f8
commit 289f591eac
5 changed files with 103 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ from gargoyle import gargoyle
from utils import installed
from eve_api.models import EVEAccount, EVEPlayerCharacter, EVEPlayerCorporation
from sso.models import ServiceAccount, Service
from sso.models import ServiceAccount, Service, SSOUserNote
from registration.forms import RegistrationForm
@@ -139,3 +139,18 @@ class PrimaryCharacterForm(forms.Form):
if self.user:
self.fields['character'].queryset = EVEPlayerCharacter.objects.filter(eveaccount__user=self.user).distinct()
class UserNoteForm(forms.ModelForm):
class Meta:
model = SSOUserNote
exclude = ('created_by', 'created_date')
widgets = {
'user': forms.HiddenInput(),
'note': forms.Textarea(),
}
def clean_note(self):
data = self.cleaned_data['note']
# Clean dodgy text?
return data