Ejemplo n.º 1
0
def manage_race_post(request):
    race = request.POST.get("race")
    reset_skills = default_skills_race_update(race)
    skills = Skills(request)
    skills.save_race(race)
    skills.save_skills(reset_skills)
    skills.save_fill_skills(None)
Ejemplo n.º 2
0
 def save(self):
     if self.is_valid():
         skills = Skills(self.request)
         skills.save_skills(self.skills)
         skills.save_desired_level(self.desired_level)
         skills.save_multiplier(self.multiplier)
         skills.save_fill_skills(self.fill_skills)
     else:
         raise SkillsValidationError(self.errors)
Ejemplo n.º 3
0
    def test_skills_save_properties_to_session(self):
        request = self.FakeRequest()
        skills = Skills(request)
        skills.save_skills({"some"})
        skills.save_desired_level(1)
        skills.save_multiplier(1.5)
        skills.save_fill_skills("true")

        self.assertDictEqual(
            request.session, {
                "skills": {"some"},
                "desired_level": 1,
                "multiplier": 1.5,
                "fill_skills": "true"
            })
Ejemplo n.º 4
0
def reset_skills(request):
    skills = Skills(request)
    race = skills.get_race()
    skills_after_reset = default_skills_race_update(race)
    skills.save_skills(skills_after_reset)
    skills.save_fill_skills(None)