Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
Test-Linux:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
container:
image: perl:5.30

Expand Down
6 changes: 0 additions & 6 deletions IFComp-Dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@ services:
- type: bind
source: ../IFComp
target: /opt/IFComp
volume:
nocopy: true
- type: bind
source: ./docker-app/docker-script
target: /opt/IFComp-Dev/script
volume:
nocopy: true
web:
build: ./docker-web
ports:
Expand All @@ -32,8 +28,6 @@ services:
- type: bind
source: ../IFComp
target: /opt/IFComp
volume:
nocopy: true
db:
image: mariadb:10.3
environment:
Expand Down
6 changes: 6 additions & 0 deletions IFComp/lib/IFComp/Controller/Entry.pm
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ sub create : Chained('root') : PathPart('create') : Args(0) {
$c->res->redirect( $c->uri_for_action('/entry/list') );
}

if ( ( !defined( $c->user->paypal ) || $c->user->paypal eq '' )
&& ( !defined( $c->user->venmo ) || $c->user->venmo eq '' ) )
{
$c->res->redirect( $c->uri_for_action('/entry/list') );
}

my %new_result_args = (
comp => $c->stash->{current_comp},
author => $c->user->get_object->id,
Expand Down
37 changes: 30 additions & 7 deletions IFComp/lib/IFComp/Form/UserFields.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ has_field 'forum_handle' => (
has_field 'paypal' => (
type => 'Text',
label =>
'Paypal address, or Venmo handle/phone number (or "decline" if not interested in monetary awards)',
'Paypal email address, or enter "decline" if not interested in monetary awards',
maxlength => 64,
);

has_field 'venmo' => (
type => 'Text',
label =>
'Venmo username/phone number, or enter "decline" if not interested in monetary awards',
maxlength => 64,
);

Expand Down Expand Up @@ -87,8 +94,7 @@ sub validate_url {

}

# The paypal field can contain "decline", a paypal email address, or
# a venmo account name / phone number. We allow all of the above.
# The paypal field can contain "decline", a paypal email address
sub validate_paypal {
my $self = shift;
my ($field) = @_;
Expand All @@ -97,16 +103,33 @@ sub validate_paypal {
return unless $payment;

if ( ( $payment eq "decline" )
|| ( Email::Valid->address($payment) )
|| ( Email::Valid->address($payment) ) )
{
$field->value($payment);
}
else {
$field->add_error("This doesn't look like a valid paypal address.");

}
}

# a venmo account name / phone number
sub validate_venmo {
my $self = shift;
my ($field) = @_;

my $payment = $field->value;
return unless $payment;

if ( ( $payment eq "decline" )
|| ( $payment =~ /^[-+()\d ]*$/ )
|| ( $payment =~ /^@\w+/ ) )
|| ( $payment =~ /^@?\w+/ ) )
{
$field->value($payment);
}
else {
$field->add_error(
"This doesn't look like a valid paypal address, venmo address, or phone number."
);
"This doesn't look like a valid venmo name or phone number.");

}
}
Expand Down
12 changes: 10 additions & 2 deletions IFComp/lib/IFComp/Schema/Result/User.pm
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ __PACKAGE__->table("user");
is_nullable: 1
size: 64

=head2 venmo

data_type: 'char'
is_nullable: 1
size: 64

=head2 rising_star

data_type: 'integer'
Expand Down Expand Up @@ -175,6 +181,8 @@ __PACKAGE__->add_columns(
{ data_type => "char", is_nullable => 1, size => 32 },
"paypal",
{ data_type => "char", is_nullable => 1, size => 64 },
"venmo",
{ data_type => "char", is_nullable => 1, size => 64 },
"rising_star",
{ data_type => "integer", is_nullable => 1 },
);
Expand Down Expand Up @@ -300,8 +308,8 @@ __PACKAGE__->has_many(

#>>>

# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-07-02 23:04:54
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QWBgb307tu4QG/bg7rfGWA
# Created by DBIx::Class::Schema::Loader v0.07053 @ 2025-06-01 20:06:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9WoAg24sR0ghQIGGZebiCw

__PACKAGE__->add_column(
'+password' => {
Expand Down
6 changes: 5 additions & 1 deletion IFComp/root/src/entry/list.tt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@
<h2>Register an entry</h2>
[% IF current_comp.status == 'accepting_intents' %]
[% IF entries.size < 3 %]
<p><a href="[% c.uri_for_action( '/entry/create' ) %]">Add a new entry.</a></p>
[% IF c.user.venmo == '' && c.user.paypal == '' %]
<p>You cannot add entries until you've speicified either a paypal or venmo account for prizes. Please visit your <a href="/user/edit_account">account profile</a> and update it.
[% ELSE %]
<p><a href="[% c.uri_for_action( '/entry/create' ) %]">Add a new entry.</a></p>
[% END %]
[% ELSE %]
<p>You can't declare any further entries this year, since you've reached the annual limit of three.</p>
[% END %]
Expand Down
12 changes: 6 additions & 6 deletions IFComp/t/lib/IFCompTestData.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sub add_test_data_to_schema {
'password_md5', 'salt_md5',
'email', 'email_is_public',
'url', 'verified',
'forum_handle',
'forum_handle', 'venmo',
],
[ 1, 'user1',
$HASHED_PASSWORD, $SALT,
Expand All @@ -40,23 +40,23 @@ sub add_test_data_to_schema {
'user1_forum',
],
[ 2, 'Alice Author', $HASHED_PASSWORD,
$SALT, 'author@example.com', 1, undef, 1, undef,
$SALT, 'author@example.com', 1, undef, 1, undef, 'aliceworks',
],
[ 3, 'Victor Votecounter',
$HASHED_PASSWORD,
$SALT, 'votecounter@example.com', 1, undef, 1, undef,
$SALT, 'votecounter@example.com', 1, undef, 1, undef, undef,
],
[ 4, 'Connie Curator',
$HASHED_PASSWORD,
$SALT, 'curator@example.com', 1, undef, 1, undef,
$SALT, 'curator@example.com', 1, undef, 1, undef, undef,
],
[ 5, 'Cheddar Cheez',
$HASHED_PASSWORD,
$SALT, 'cheez@example.com', 1, undef, 1, undef,
$SALT, 'cheez@example.com', 1, undef, 1, undef, undef,
],
[ 6, 'Patricia Prizemanager',
$HASHED_PASSWORD,
$SALT, 'prizes@example.com', 1, undef, 1, undef,
$SALT, 'prizes@example.com', 1, undef, 1, undef, undef,
],
],
);
Expand Down