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

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

10 Apr 2024 06:33PM UTC coverage: 26.016% (-59.8%) from 85.772%
301

push

travis-pro

web-flow
Merge pull request #95 from gcivil-nyu-org/user-home

User home

128 of 492 relevant lines covered (26.02%)

0.26 hits per line

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

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

8

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

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

20
    def clean_username(self):
1✔
21
        username = self.cleaned_data["username"]
×
22
        if CustomUser.objects.filter(username=username).exists():
×
23
            raise ValidationError("Username already exists.")
×
24
        return username
×
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