-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update models, serializers, and tests for user registration #17
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: delano <delano@cpan.org>
Signed-off-by: delano <delano@cpan.org>
Signed-off-by: delano <delano@cpan.org>
coverage, and ipdb Signed-off-by: delano <delano@cpan.org>
Includes `User = get_user_model()` fix for "_meta" field error. Signed-off-by: delano <delano@cpan.org>
Signed-off-by: delano <delano@cpan.org>
Signed-off-by: delano <delano@cpan.org>
Signed-off-by: delano <delano@cpan.org>
models Signed-off-by: delano <delano@cpan.org>
Signed-off-by: delano <delano@cpan.org>
Several dependencies have been added to requirements.txt including: - 'appnope' - 'asttokens' - 'coverage' - 'decorator' - 'executing' - 'iniconfig' - 'ipdb' - 'ipython' - 'jedi' - 'matplotlib-inline' - 'parso' - 'pexpect' - 'pluggy' - 'prompt-toolkit' - 'ptyprocess' - 'pure-eval' - 'pygments' - 'pytest' - 'pytest-django' - 'six' - 'stack-data' - 'traitlets' - 'wcwidth' Moreover, a few dependencies have been updated such as: - 'django-unfold' from version 0.14.2 to 0.15.1 - Change usage of 'build' on 'packaging'. Now it also involves 'pytest' It appears that most of these changes were prompted by the need to use 'ipython' and 'pytest' as these are recurring in the 'via' comments. Signed-off-by: delano <delano@cpan.org>
New user registration functionality has been implemented. A new route `api/auth/register/` has been added to the `urls.py` file to handle user registration using the `RegisterView`. Significant changes have been made to `serializers/__init__.py` with the addition of `RegisterSerializer`. This new serializer validates the user information and checks the password and password confirmation fields for a match. A register user test has been added as well, located in the new file `__test_userview_register.py`. Apart from registration related changes, the file `test__userview.py` has been renamed to `__test__userview.py`. Signed-off-by: delano <delano@cpan.org>
Refactored user and registration serializers in `afbcore` by modularizing the code for better maintainability, and also created a new test for the user view. User and Register serializers previously in `__init__.py` are now in separate modules: `user_serializer.py` and `register_user_serializer.py`. A test for user views has also been implemented in `test_user_view.py` including methods for setting up, tearing down, and two tests: validating the registration process. Signed-off-by: delano <delano@cpan.org>
In the RegisterUserSerializer, additional fields mandatory for user registration have been included, like password2 and optional fields like first_name, last_name. The password matching validation is added, and a new user account can be created using these details. In the tests, tests for registering a user with valid data, simple password, invalid email, password mismatch and short password scenarios are added. The serializer, in all these test cases, validates the incoming data and asserts the expected behavior. New users are created for successful scenarios, and the input data is compared for verification. Signed-off-by: delano <delano@cpan.org>
Signed-off-by: delano <delano@cpan.org>
- Split delivery_region into separate file - Created a new Django migrations file to add numerous new fields to the "branch", "deliveryregion", and "profile" models. - For both deliveryregion and profile, the fields "created", "modified", and "is_removed" have been added. - Additional specific attributes added to the deliveryregion model, such as "country", "city", "address lines", "postal code" and "state or province". - Modification in the afbcore models init file where "DeliveryRegion" has been split from the "delivery" Python file into its own separate file "delivery_region". - Refactoring on the DeliveryRegion class - now it inherits from the BaseAbstractModel and PhysicalLocationMixin. The DeliveryRegion class was moved from "delivery.py" to a new file called "delivery_region.py". This refactoring adds several utility methods and fields to the DeliveryRegion model. - Added a comment block in "base.py" suggesting usage of BaseAbstractModel. Signed-off-by: delano <delano@cpan.org>
Signed-off-by: delano <delano@cpan.org>
Signed-off-by: delano <delano@cpan.org>
Add unique constraint on name field and validate name field on save and clean methods Signed-off-by: delano <delano@cpan.org>
In the afb settings of our API app, we made a revision to our list of installed apps. The unused applications `crispy_forms`, `tailwind`, and `crispy_tailwind` were removed from the list in order to declutter and streamline our app. Meanwhile, we added `rest_framework` and `django_filters`, the latter of which is a dependency of Django Rest Framework. These new inclusions will enhance the functionality and efficiency of our Django project, with `rest_framework` providing a powerful and flexible toolkit for building Web APIs, and `django_filters` promoting filterable data for Django models. Signed-off-by: delano <delano@cpan.org>
"Unused apps cleared from INSTALLED_APPS" Further detailed description: - Removed "django_browser_reload" from the INSTALLED_APPS list in settings.py. This app was initially included for browser reloading during template development but isn't needed anymore. - Also removed the commented out 'theme' app as it is not being used. The initial plan was to use it with Tailwind CSS, but the front-end is now a separate Vue app. Signed-off-by: delano <delano@cpan.org>
Signed-off-by: delano <delano@cpan.org>
- In `settings.py`, middleware `BrowserReloadMiddleware` was removed. This middleware was primarily used in development to reload browsers whenever a change in the project files was detected. - In `urls.py`, the `__reload__` URL path used for triggering browser reloads was also removed. This path was associated with the browser reload middleware. - Commented out `MyLoginView` related login path is also removed. Signed-off-by: delano <delano@cpan.org>
Signed-off-by: delano <delano@cpan.org>
Signed-off-by: delano <delano@cpan.org>
delano
force-pushed
the
feature/20231102-add-rest-profiles
branch
from
November 4, 2023 20:46
e3d8acf
to
6cff491
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes related to user registration functionality. A new route
api/auth/register/
has been added to theurls.py
file to handle user registration using theRegisterView
. Significant changes have been made toserializers/__init__.py
with the addition ofRegisterSerializer
. This new serializer validates the user information and checks the password and password confirmation fields for a match. A register user test has been added as well, located in the new file__test_userview_register.py
.Apart from registration related changes, the file
test__userview.py
has been renamed to__test__userview.py
. Refactored user and registration serializers inafbcore
by modularizing the code for better maintainability, and also created a new test for the user view. User and Register serializers previously in__init__.py
are now in separate modules:user_serializer.py
andregister_user_serializer.py
. A test for user views has also been implemented intest_user_view.py
including methods for setting up, tearing down, and two tests: validating the registration process. Additionally, user model tests have been added and test files have been updated. Fixes #1234.