Beispiel #1
0
 def highest_stage(self):
     if self.highest_stage_reached is not None and self.highest_stage_reached != "":
         return convert(
             self.highest_stage_reached
         ) or 1  # Ensure 1 is used if non truthy is converted...
     else:
         return None
Beispiel #2
0
    def progress(self):
        """
        Return current max stage progress.
        """
        from settings import STAGE_CAP

        stage = int(convert(self.highest_stage_reached)) if self.highest_stage_reached else 0

        return {
            "stage": stage,
            "max_stage": STAGE_CAP,
            "percent": round(stage / STAGE_CAP * 100, 2)
        }
Beispiel #3
0
 def highest_stage(self):
     if self.highest_stage_reached is not None and self.highest_stage_reached != "":
         return convert(self.highest_stage_reached)
     else:
         return None