mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 11:27:09 +00:00
fix: Only allow users to create rels as source
There is now no field for users to define the source of a relationship The source is always the person in the URL And only that user or staff can access the form
This commit is contained in:
@@ -8,7 +8,7 @@ from django import forms
|
||||
from django.forms.widgets import SelectDateWidget
|
||||
from django.utils import timezone
|
||||
|
||||
from django_select2.forms import Select2Widget, Select2MultipleWidget
|
||||
from django_select2.forms import ModelSelect2Widget, Select2Widget, Select2MultipleWidget
|
||||
|
||||
from . import models
|
||||
|
||||
@@ -60,6 +60,12 @@ class PersonForm(forms.ModelForm):
|
||||
years=get_date_year_range())
|
||||
|
||||
|
||||
class RelationshipForm(forms.Form):
|
||||
target = forms.ModelChoiceField(
|
||||
models.Person.objects.all(),
|
||||
widget=ModelSelect2Widget(search_fields=['name__icontains']))
|
||||
|
||||
|
||||
class DynamicAnswerSetBase(forms.Form):
|
||||
field_class = forms.ModelChoiceField
|
||||
field_widget = None
|
||||
|
||||
Reference in New Issue
Block a user