Commit 0ae94a54 authored by John Red Medrano's avatar John Red Medrano

{dev bugfix} bugfix on update of user and application

parent c0703d79
...@@ -115,7 +115,7 @@ class rms: ...@@ -115,7 +115,7 @@ class rms:
) )
is_excel_code_exist = self.queryset.filter( is_excel_code_exist = self.queryset.filter(
excel_code=payload['excel_code'] excel_code=payload['excel_code']
) ).exclude(code=self.kwargs['code'])
if is_excel_code_exist: if is_excel_code_exist:
return error_message( return error_message(
'400', "This excel code is already exists", '400', "This excel code is already exists",
...@@ -130,7 +130,15 @@ class rms: ...@@ -130,7 +130,15 @@ class rms:
@wraps(function) @wraps(function)
def wrapper(self, request, *args, **kwargs): def wrapper(self, request, *args, **kwargs):
payload = request.data payload = request.data
username = self.queryset.filter(username=payload['username']) if request.method == 'POST':
username = self.queryset.filter(
username=payload['username']
)
else:
username = self.queryset.filter(
username=payload['username']
).exclude(code=self.kwargs['code'])
username = username
if username.count() >= 1: if username.count() >= 1:
return error_message( return error_message(
'400', '400',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment