Permalink
Browse files

Merge pull request #65 from annttu/birth_year

Hide a birth year field if member is organization
  • Loading branch information...
2 parents 5948906 + 5b93e85 commit 2d563b33275d06c0d1085f557a499998ab01cf9b @annttu annttu committed Mar 26, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 membership/views.py
View
@@ -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'):

0 comments on commit 2d563b3

Please sign in to comment.