Allow declaring student rate on signup
This commit is contained in:
parent
6ad026e3d8
commit
6bab989d42
|
@ -315,6 +315,10 @@ class MemberSerializer(serializers.ModelSerializer):
|
||||||
signup_helper = get_object_or_404(models.Member, id=helper_id)
|
signup_helper = get_object_or_404(models.Member, id=helper_id)
|
||||||
instance.signup_helper = signup_helper.user
|
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:
|
if 'discourse_username' in validated_data:
|
||||||
changed = validated_data['discourse_username'] != instance.discourse_username
|
changed = validated_data['discourse_username'] != instance.discourse_username
|
||||||
if changed and utils_auth.discourse_is_configured():
|
if changed and utils_auth.discourse_is_configured():
|
||||||
|
|
|
@ -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}>
|
{isSignup && <Form.Field error={error.member_id}>
|
||||||
<label>Who helped you sign up? (search)</label>
|
<label>Who helped you sign up? (search)</label>
|
||||||
<MembersDropdown
|
<MembersDropdown
|
||||||
|
|
Loading…
Reference in New Issue
Block a user