This prevents normal users from adding contacts. Not sure if this is
what we want yet, though.
from xerxes.influences.models import Character
from xerxes.influences.models import Influence
from forms import get_influence_comment_form, InfluenceForm, CharacterForm
from xerxes.influences.models import Character
from xerxes.influences.models import Influence
from forms import get_influence_comment_form, InfluenceForm, CharacterForm
-from xerxes.tools.misc import make_choices
+from xerxes.tools.misc import make_choices, filter_choices
@login_required
def add_influence(request, character_id=None):
@login_required
def add_influence(request, character_id=None):
@login_required
def add_character(request):
f = CharacterForm(request=request)
@login_required
def add_character(request):
f = CharacterForm(request=request)
+ f.fields['type'].choices = filter_choices(
+ f.fields['type'].choices,
+ [Character.PLAYER, Character.NPC]
+ )
if (f.is_valid()):
character = f.save(commit=False)
character.player = request.user
if (f.is_valid()):
character = f.save(commit=False)
character.player = request.user