• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gcivil-nyu-org / INET-Wednesday-Spring2024-Team-1 / 342

30 Apr 2024 07:50PM UTC coverage: 83.513%. Remained the same
342

Pull #122

travis-pro

web-flow
Merge 56f0cabc5 into 12481fa66
Pull Request #122: refactored grocery store functions

466 of 558 relevant lines covered (83.51%)

1.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/users/forms.py
1
# from django.contrib.auth.forms import UserCreationForm
2
from django import forms
2✔
3
from .models import CustomUser
2✔
4
from django.contrib.auth.models import User
2✔
5
from django.core.exceptions import ValidationError
2✔
6
from django.contrib.auth.hashers import make_password
2✔
7

8

9
class UserSignUpForm(forms.Form):
2✔
10
    username = forms.CharField(max_length=150)
2✔
11
    email = forms.EmailField(max_length=150)
2✔
12
    password = forms.CharField(widget=forms.PasswordInput())
2✔
13

14
    def clean_email(self):
2✔
15
        email = self.cleaned_data["email"]
1✔
16
        if User.objects.filter(email=email).exists():
1✔
17
            raise ValidationError("Email already exists.")
1✔
18
        return email
1✔
19

20
    def clean_username(self):
2✔
21
        username = self.cleaned_data["username"]
1✔
22
        if CustomUser.objects.filter(username=username).exists():
1✔
23
            raise ValidationError("Username already exists.")
1✔
24
        return username
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc