Allow declaring student rate on signup

This commit is contained in:
Tanner Collin 2023-08-23 01:18:26 +00:00
parent 6ad026e3d8
commit 6bab989d42
2 changed files with 19 additions and 0 deletions

View File

@ -315,6 +315,10 @@ class MemberSerializer(serializers.ModelSerializer):
signup_helper = get_object_or_404(models.Member, id=helper_id)
instance.signup_helper = signup_helper.user
is_student = self.initial_data.get('is_student', False)
if is_student:
instance.monthly_fees = 35
if 'discourse_username' in validated_data:
changed = validated_data['discourse_username'] != instance.discourse_username
if changed and utils_auth.discourse_is_configured():

View File

@ -301,6 +301,21 @@ export function AccountForm(props) {
</>
}
{isSignup && <Form.Field>
<label>Are you a student / low-income?</label>
<Form.Checkbox
label='Yes'
name='is_student'
onChange={handleCheck}
checked={input.is_student}
error={error.is_student ?
{ content: error.is_student, pointing: 'left' }
:
false
}
/>
</Form.Field>}
{isSignup && <Form.Field error={error.member_id}>
<label>Who helped you sign up? (search)</label>
<MembersDropdown