Skip to content

Commit

Permalink
Merge pull request #65 from annttu/birth_year
Browse files Browse the repository at this point in the history
Hide a birth year field if member is organization
  • Loading branch information
annttu committed Mar 26, 2013
2 parents 5948906 + 5b93e85 commit 2d563b3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions membership/views.py
Expand Up @@ -770,6 +770,10 @@ def disable_fields(self):
self.fields['status'].widget.attrs['readonly'] = 'readonly'
self.fields['approved'].required = False
self.fields['approved'].widget.attrs['readonly'] = 'readonly'
instance = getattr(self, 'instance', None)
if instance and instance.type == 'O':
self.fields["birth_year"].widget = HiddenInput()
self.fields['birth_year'].required = False

if request.method == 'POST':
if not request.user.has_perm('membership.manage_members'):
Expand Down

0 comments on commit 2d563b3

Please sign in to comment.