princekhunt / privateping

PrivatePing is a secure messaging application built on Python's Django framework, providing end-to-end encryption for messages exchanged between users.
https://privateping.bytespot.tech
MIT License
125 stars 30 forks source link

Improve anonymous direct login function #1

Closed princekhunt closed 3 months ago

princekhunt commented 3 months ago

In the anonymous direct login function, .create function is used.

user = User.objects.create_user(username=username, email=email, password=password) user_type_obj = user_type.objects.create(user=user, type="Anonymous") profile = UserProfile.objects.create(email=email, name=username, username=username)

Here, there is no requirement of defining variables (user, user_type_obj and profile).

https://github.com/princekhunt/privateping/blob/e48877c70e9dfd0132847ade7d8aa665f790fbba/registration/views.py#L167