Skip to content

Commit

Permalink
Merge pull request #13 from EdinsonRequena/refactor/update-users-views
Browse files Browse the repository at this point in the history
Add user views and models
  • Loading branch information
EdinsonRequena authored Jan 14, 2024
2 parents ee26d3a + 804fb53 commit 685e6bc
Show file tree
Hide file tree
Showing 16 changed files with 400 additions and 338 deletions.
5 changes: 5 additions & 0 deletions users/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
USER_WITH_ID_NOT_FOUND = "User with ID %s does not exist."
USER_NOT_FOUND_MESSAGE = "User not found."
WRONG_CREDENTIALS_ERROR = "Wrong credentials."
FAILED_LOGIN_ATTEMPT = "Failed login attempt for username: %s"
MISSING_FIELD_ERROR = "Missing field: "
1 change: 1 addition & 0 deletions users/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .custom_user_models import CustomUser # pylint: disable=unused-import
2 changes: 1 addition & 1 deletion users/models.py → users/models/custom_user_models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.translation import gettext_lazy as _


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from django.test import TestCase
from django.core.files.uploadedfile import SimpleUploadedFile

from users.models import CustomUser
from users.models.custom_user_models import CustomUser


class CustomUserModelTest(TestCase):
Expand Down
157 changes: 0 additions & 157 deletions users/tests/test_views.py

This file was deleted.

4 changes: 3 additions & 1 deletion users/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from django.urls import path
from users.views import RegisterUserAPIView, LoginUserAPIView, UserProfileAPIView
from users.views.user_login_view import LoginUserAPIView
from users.views.user_profile_view import UserProfileAPIView
from users.views.user_register_view import RegisterUserAPIView

urlpatterns = [
path('users/register/', RegisterUserAPIView.as_view(), name='register_user'),
Expand Down
178 changes: 0 additions & 178 deletions users/views.py

This file was deleted.

Empty file added users/views/__init__.py
Empty file.
Empty file added users/views/tests/__init__.py
Empty file.
Loading

0 comments on commit 685e6bc

Please sign in to comment.