Finds the rank of the user. Returns a member of the Rank enum: either Rank.NEW_SCRATCHER, Rank.SCRATCHER, or Rank.SCRATCH_TEAM. May replace user.scratchteam and user.is_new_scratcher in the future.
(self)
| 1207 | return v |
| 1208 | |
| 1209 | def rank(self) -> Rank: |
| 1210 | """ |
| 1211 | Finds the rank of the user. |
| 1212 | Returns a member of the Rank enum: either Rank.NEW_SCRATCHER, Rank.SCRATCHER, or Rank.SCRATCH_TEAM. |
| 1213 | May replace user.scratchteam and user.is_new_scratcher in the future. |
| 1214 | """ |
| 1215 | |
| 1216 | if self.is_new_scratcher(): |
| 1217 | return Rank.NEW_SCRATCHER |
| 1218 | |
| 1219 | if not self.scratchteam: |
| 1220 | return Rank.SCRATCHER |
| 1221 | |
| 1222 | return Rank.SCRATCH_TEAM |
| 1223 | |
| 1224 | |
| 1225 | # ------ # |