Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
felixgondwe committed Mar 14, 2019
1 parent 027f5a9 commit 73456c3
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/curation_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,6 @@ def get_username_from_db_uri():

@view_config(route_name='add_new_colleague_triage', renderer='json', request_method='POST')
def add_new_colleague_triage(request):

if not check_csrf_token(request, raises=False):
return HTTPBadRequest(body=json.dumps({'error': 'Bad CSRF Token'}))
params = request.json_body
Expand All @@ -977,14 +976,9 @@ def add_new_colleague_triage(request):
msg = 'You entered an ORCID or Email which is already being used by an SGD colleague. Try to find your entry or contact sgd-helpdesk@lists.stanford.edu if you think this is a mistake.'
return HTTPBadRequest(body=json.dumps({'message': msg}), content_type='text/json')
try:

username = request.session['username']
full_name = params['first_name'] + ' ' + params['last_name']
# add a random number to be sure it's unique
format_name = set_string_format(full_name) + str(randint(1, 100))

created_by = username # if username else get_username_from_db_uri()

new_c_triage = Colleaguetriage(
json=json.dumps(params),
triage_type='New',
Expand Down

0 comments on commit 73456c3

Please sign in to comment.