ThomasSimonini HF staff commited on
Commit
755b426
·
1 Parent(s): 3462e86

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -331,9 +331,8 @@ def generate_certificate(certificate_model, first_name, last_name):
331
  def add_certified_user(hf_username, first_name, last_name, pass_percentage):
332
  repo.git_pull()
333
  history = pd.read_csv(os.path.join(CERTIFIED_USERS_DIR, CERTIFIED_USERS_FILENAME))
334
- new_row = pd.DataFrame({'hf_username': hf_username, 'first_name': first_name, 'last_name': last_name, 'pass_percentage': pass_percentage, 'datetime': time.time()})
335
- new_history = pd.DataFrame(new_row)
336
- history = pd.concat([history, new_history], ignore_index=True)
337
  print("HISTORY", history)
338
  history.to_csv(os.path.join(CERTIFIED_USERS_DIR, CERTIFIED_USERS_FILENAME), index=False)
339
  df.to_csv(os.path.join(CERTIFIED_USERS_DIR, CERTIFIED_USERS_FILENAME), index=False)
 
331
  def add_certified_user(hf_username, first_name, last_name, pass_percentage):
332
  repo.git_pull()
333
  history = pd.read_csv(os.path.join(CERTIFIED_USERS_DIR, CERTIFIED_USERS_FILENAME))
334
+ new_history = pd.DataFrame({'hf_username': hf_username, 'first_name': first_name, 'last_name': last_name, 'pass_percentage': pass_percentage, 'datetime': time.time()}, index=[0])
335
+ history = pd.concat([new_row, history[:]]).reset_index(drop=True)
 
336
  print("HISTORY", history)
337
  history.to_csv(os.path.join(CERTIFIED_USERS_DIR, CERTIFIED_USERS_FILENAME), index=False)
338
  df.to_csv(os.path.join(CERTIFIED_USERS_DIR, CERTIFIED_USERS_FILENAME), index=False)