Skip to content

Commit

Permalink
Merge pull request #1606 from gtech-mulearn/dev
Browse files Browse the repository at this point in the history
fix register
  • Loading branch information
adnankattekaden authored Nov 24, 2023
2 parents df4e9d6 + 4090769 commit 934a97a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions api/register/register_views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import decouple
import requests
from django.db.models import Q

from rest_framework.views import APIView

from db.organization import Country, Department, District, Organization, State, Zone
Expand Down Expand Up @@ -95,6 +92,7 @@ def post(self, request):


class RegisterDataAPI(APIView):

def post(self, request):
data = request.data
data = {key: value for key, value in data.items() if value}
Expand Down
2 changes: 1 addition & 1 deletion api/register/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def create(self, validated_data):
role = validated_data.pop("role", None)

validated_data["muid"] = register_helper.generate_muid(
validated_data["first_name"], validated_data["last_name"]
validated_data["first_name"], validated_data.get('last_name', '')
)
password = validated_data.pop("password")
hashed_password = make_password(password)
Expand Down

0 comments on commit 934a97a

Please sign in to comment.