Skip to content

Commit

Permalink
[#2185] Allow indicator updates on private projects
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperBrandt committed Jun 16, 2016
1 parent 9e02939 commit 7da5ec2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions akvo/rsr/models/indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,9 @@ def clean(self):
project = self.period.indicator.result.project

# Don't allow a data update to a private or unpublished project
if not (project.is_public and project.is_published()):
if not project.is_published():
validation_errors['period'] = unicode(_(u'Indicator period must be part of a published '
u'and public project to add data to it'))
u'project to add data to it'))
raise ValidationError(validation_errors)

# Don't allow a data update to a non-Impact project
Expand All @@ -694,7 +694,8 @@ def clean(self):
orig = IndicatorPeriodData.objects.get(pk=self.pk)
# Don't allow an approved data update to be changed
if orig.status == self.STATUS_APPROVED_CODE:
# TODO
# TODO: Allow edits of updates, similar to:
# self.period.update_actual_value(new_data - old_data, self.relative_data)
validation_errors['status'] = unicode(_(u'Not allowed to change approved data '
u'updates'))

Expand Down

0 comments on commit 7da5ec2

Please sign in to comment.