Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code duplication for merge/personalization feature #1063

Closed
racke opened this issue Dec 23, 2020 · 0 comments · Fixed by #1064
Closed

Fix code duplication for merge/personalization feature #1063

racke opened this issue Dec 23, 2020 · 0 comments · Fixed by #1064
Labels
dry Don't repeat yourself Refactoring needed
Milestone

Comments

@racke
Copy link
Contributor

racke commented Dec 23, 2020

Same block of code appears four times in `Sympa::Spindle::AuthorizeMessage which is a violation of the DRY rule.

        # Check syntax for merge_feature.
        if (    $message->{shelved}{merge}
            and $message->{shelved}{merge} ne 'footer'
            and not _test_personalize($message, $list)) {
            $log->syslog(
                'err',
                'Failed to personalize. Message %s for list %s was rejected',
                $message,
                $list
            );
            Sympa::send_dsn($list, $message, {}, '5.6.5');
            return undef;
        }

@ikedas ikedas mentioned this issue Dec 24, 2020
@ikedas ikedas added this to the 6.2.62 milestone Dec 24, 2020
@ikedas ikedas added dry Don't repeat yourself Refactoring needed labels Jan 5, 2021
ikedas added a commit that referenced this issue Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dry Don't repeat yourself Refactoring needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants