Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
event_team = submission.event_team
event = event_team.event
source_submissions = get_source_submissions(db.session, submission.id)
def get_s_field(source_submission):
return '{}/{}/{}'.format(
source_submission.event_team.event.name,
source_submission.event_team.team.name,
source_submission.name)
# Make sure that CreditForm is empty
CreditForm.name_credits = []
credit_form_kwargs = {}
for source_submission in source_submissions:
s_field = get_s_field(source_submission)
setattr(CreditForm, s_field, StringField('Text'))
credit_form = CreditForm(**credit_form_kwargs)
sum_credit = 0
# new = True
for source_submission in source_submissions:
s_field = get_s_field(source_submission)
submission_similaritys = \
(SubmissionSimilarity.query
.filter_by(
type='target_credit',
user=flask_login.current_user,
source_submission=source_submission,
target_submission=submission)
.all())
if not submission_similaritys:
submission_credit = 0
else:
event = event_team.event
source_submissions = get_source_submissions(db.session, submission.id)
def get_s_field(source_submission):
return '{}/{}/{}'.format(
source_submission.event_team.event.name,
source_submission.event_team.team.name,
source_submission.name)
# Make sure that CreditForm is empty
CreditForm.name_credits = []
credit_form_kwargs = {}
for source_submission in source_submissions:
s_field = get_s_field(source_submission)
setattr(CreditForm, s_field, StringField('Text'))
credit_form = CreditForm(**credit_form_kwargs)
sum_credit = 0
# new = True
for source_submission in source_submissions:
s_field = get_s_field(source_submission)
submission_similaritys = \
(SubmissionSimilarity.query
.filter_by(
type='target_credit',
user=flask_login.current_user,
source_submission=source_submission,
target_submission=submission)
.all())
if not submission_similaritys:
submission_credit = 0
else:
# new = False