CalPolySEC / wrath-ctf-framework

What? Really? AnoTHer CTF Framework :triangular_flag_on_post:
MIT License
11 stars 4 forks source link

Address TODO in ctf/core.py:32 #16

Closed sig1nt closed 8 years ago

sig1nt commented 8 years ago

Even if it's just to remove it

maxzinkus commented 8 years ago

For reference

def get_teams():
    # TODO: Team.points ought to be a SQL sum instead of denormalized
    return Team.query.order_by(Team.points.desc(), Team.last_fleg).all()

from https://github.com/DeltaHeavy/wrath-ctf-framework/blob/master/ctf/core.py#L32

maxzinkus commented 8 years ago

Should it be? I leave this up to our friendly neighborhood SQLAlchemist and DBA, Nick and Nick, respectively

slashnick commented 8 years ago

This is a pretty classic atomicity problem. Enter two flegs at the same time, and your read-update-write will only add one of them to your score. Since the score is just a sum of your flegs anyway, we should reflect that in the implementation.

(Now, if someone actually enters two flegs at the same time, they're probably cheating.)

slashnick commented 8 years ago

This is potentially closed by #26.

maxzinkus commented 8 years ago

Close with #26