Explain when people need to sign up for Spaceport
This commit is contained in:
parent
b8dc5467d8
commit
64e7f4d8f4
|
@ -84,6 +84,21 @@ class TransactionSerializer(serializers.ModelSerializer):
|
||||||
member = get_object_or_404(models.Member, id=validated_data['member_id'])
|
member = get_object_or_404(models.Member, id=validated_data['member_id'])
|
||||||
if member.user:
|
if member.user:
|
||||||
validated_data['user'] = member.user
|
validated_data['user'] = member.user
|
||||||
|
|
||||||
|
if validated_data['account_type'] != 'Clearing':
|
||||||
|
if validated_data['amount'] == 0:
|
||||||
|
raise ValidationError(dict(account_type='You can\'t have a $0 {} transaction. Do you want "Membership Adjustment"?'.format(validated_data['account_type'])))
|
||||||
|
elif validated_data['amount'] < 0.1:
|
||||||
|
raise ValidationError(dict(amount='Don\'t try and trick me.'))
|
||||||
|
|
||||||
|
if validated_data['account_type'] == 'PayPal':
|
||||||
|
msg = 'Manual PayPal transaction added:\n' + str(validated_data)
|
||||||
|
utils.alert_tanner(msg)
|
||||||
|
|
||||||
|
if validated_data['account_type'] in ['Interac', 'Dream Pmt', 'Square Pmt', 'PayPal']:
|
||||||
|
if not validated_data.get('reference_number', None):
|
||||||
|
raise ValidationError(dict(reference_number='This field is required.'))
|
||||||
|
|
||||||
return super().create(validated_data)
|
return super().create(validated_data)
|
||||||
|
|
||||||
def update(self, instance, validated_data):
|
def update(self, instance, validated_data):
|
||||||
|
@ -632,6 +647,10 @@ class MyPasswordChangeSerializer(PasswordChangeSerializer):
|
||||||
class MyPasswordResetSerializer(PasswordResetSerializer):
|
class MyPasswordResetSerializer(PasswordResetSerializer):
|
||||||
def validate_email(self, email):
|
def validate_email(self, email):
|
||||||
if not User.objects.filter(email__iexact=email).exists():
|
if not User.objects.filter(email__iexact=email).exists():
|
||||||
|
if models.Member.objects.filter(old_email__iexact=email).exists():
|
||||||
|
logging.info('Email hasn\'t migrated to Spaceport yet: ' + email)
|
||||||
|
raise ValidationError('Not on Spaceport.')
|
||||||
|
else:
|
||||||
logging.info('Email not found: ' + email)
|
logging.info('Email not found: ' + email)
|
||||||
raise ValidationError('Not found.')
|
raise ValidationError('Not found.')
|
||||||
return super().validate_email(email)
|
return super().validate_email(email)
|
||||||
|
|
|
@ -40,11 +40,6 @@ export function LoginForm(props) {
|
||||||
>
|
>
|
||||||
<Header size='medium'>Log In to Spaceport</Header>
|
<Header size='medium'>Log In to Spaceport</Header>
|
||||||
|
|
||||||
<Message warning>
|
|
||||||
<Message.Header>First time at the new portal?</Message.Header>
|
|
||||||
<p>Sign up below from Protospace Wi-Fi / computers.</p>
|
|
||||||
</Message>
|
|
||||||
|
|
||||||
<Form.Input
|
<Form.Input
|
||||||
label='Username'
|
label='Username'
|
||||||
name='username'
|
name='username'
|
||||||
|
@ -109,6 +104,11 @@ export function SignupForm(props) {
|
||||||
const interval = setInterval(getStatus, 500);
|
const interval = setInterval(getStatus, 500);
|
||||||
|
|
||||||
const data = { ...input, email: input.email.toLowerCase(), bypass_code: bypass_code, request_id: request_id };
|
const data = { ...input, email: input.email.toLowerCase(), bypass_code: bypass_code, request_id: request_id };
|
||||||
|
|
||||||
|
if (bypass_code) {
|
||||||
|
data.existing_member = true;
|
||||||
|
}
|
||||||
|
|
||||||
requester('/registration/', 'POST', '', data)
|
requester('/registration/', 'POST', '', data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
|
@ -161,7 +161,7 @@ export function SignupForm(props) {
|
||||||
error={error.email}
|
error={error.email}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Form.Group grouped>
|
{!!bypass_code || <Form.Group grouped>
|
||||||
<Form.Radio
|
<Form.Radio
|
||||||
label='I have an account on the old portal'
|
label='I have an account on the old portal'
|
||||||
name='existing_member'
|
name='existing_member'
|
||||||
|
@ -178,7 +178,7 @@ export function SignupForm(props) {
|
||||||
onChange={handleValues}
|
onChange={handleValues}
|
||||||
error={!!error.existing_member}
|
error={!!error.existing_member}
|
||||||
/>
|
/>
|
||||||
</Form.Group>
|
</Form.Group>}
|
||||||
|
|
||||||
<Form.Input
|
<Form.Input
|
||||||
label='Password'
|
label='Password'
|
||||||
|
|
|
@ -37,7 +37,7 @@ function ResetForm() {
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form onSubmit={handleSubmit} error={error.email == 'Not found.'}>
|
<Form onSubmit={handleSubmit} error={!!error.email}>
|
||||||
<Form.Input
|
<Form.Input
|
||||||
label='Email'
|
label='Email'
|
||||||
name='email'
|
name='email'
|
||||||
|
@ -45,11 +45,28 @@ function ResetForm() {
|
||||||
error={error.email}
|
error={error.email}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{error.email == 'Not found.' &&
|
||||||
<Message
|
<Message
|
||||||
error
|
error
|
||||||
header='Email not found in Spaceport'
|
header='Email not found in Spaceport'
|
||||||
content='Ask a director if you forgot which one you used.'
|
content='Ask a director if you forgot which one you used.'
|
||||||
/>
|
/>
|
||||||
|
}
|
||||||
|
|
||||||
|
{error.email == 'Not on Spaceport.' &&
|
||||||
|
<Message
|
||||||
|
error
|
||||||
|
header={'You haven\'t registered to Spaceport yet'}
|
||||||
|
content={
|
||||||
|
<>
|
||||||
|
Please sign up to the new portal here:<br />
|
||||||
|
<Link to='/#outside-protospace-15c7b5'>
|
||||||
|
Spaceport Registration
|
||||||
|
</Link>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
|
||||||
<Form.Button loading={loading} error={error.non_field_errors}>
|
<Form.Button loading={loading} error={error.non_field_errors}>
|
||||||
Submit
|
Submit
|
||||||
|
|
Loading…
Reference in New Issue
Block a user