summaryrefslogtreecommitdiff
path: root/archaeological_finds/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/forms.py')
-rw-r--r--archaeological_finds/forms.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py
index b77560ac9..cf08e1a19 100644
--- a/archaeological_finds/forms.py
+++ b/archaeological_finds/forms.py
@@ -448,7 +448,7 @@ class QAFindBasketForm(IshtarForm):
choices=(('create', _(u"Create")),
('update', _(u"Update"))), initial='create')
label = forms.CharField(label="", max_length=None, required=False)
- basket = forms.ChoiceField(label=_(u"Basket"), required=True, choices=[])
+ basket = forms.ChoiceField(label=_(u"Basket"), required=False, choices=[])
def __init__(self, *args, **kwargs):
self.user = None
@@ -468,6 +468,9 @@ class QAFindBasketForm(IshtarForm):
def clean(self):
if self.cleaned_data['create_or_update'] == 'update':
+ if not self.cleaned_data['basket']:
+ raise forms.ValidationError(
+ _(u"On update, you have to select a basket."))
return self.cleaned_data
label = self.cleaned_data['label'].strip()
if not label:
@@ -986,8 +989,8 @@ class FindBasketAddItemForm(forms.Form):
raise PermissionDenied
# check rights
if not user.user_ptr.is_superuser and \
- not user.has_right('change_find') and \
- not (user.has_right('change_own_find')
+ not user.has_right('view_find') and \
+ not (user.has_right('view_own_find')
and item.is_own(user)):
raise PermissionDenied
basket.items.add(item)