Commit a702aecdae1d47b1482eb6c9f3ceb35cc862d210

Authored by Miguel Barão
1 parent 6531a56e
Exists in dev

minor

Showing 2 changed files with 15 additions and 15 deletions   Show diff stats
perguntations/app.py
... ... @@ -364,9 +364,9 @@ class App:
364 364 elif cmd == "size":
365 365 self._set_screen_area(uid, value)
366 366 elif cmd == "update_answer":
367   - print(cmd, value) # FIXME
  367 + print(cmd, value) # FIXME:
368 368 elif cmd == "lint":
369   - print(cmd, value) # FIXME
  369 + print(cmd, value) # FIXME:
370 370  
371 371 # ========================================================================
372 372 # GETTERS
... ...
perguntations/initdb.py
... ... @@ -179,30 +179,30 @@ def main():
179 179 # --- insert new students
180 180 if students:
181 181 if args.pw is None:
182   - print('Set passwords to empty')
  182 + print("Set passwords to empty")
183 183 for s in students:
184   - s['pw'] = ''
  184 + s["pw"] = ""
185 185 else:
186   - print('Generating password hashes')
  186 + print("Generating password hashes")
187 187 for s in students:
188   - s['pw'] = ph.hash(args.pw)
189   - print('.', end='', flush=True)
190   - print(f'\nInserting {len(students)}')
  188 + s["pw"] = ph.hash(args.pw)
  189 + print(".", end="", flush=True)
  190 + print(f"\nInserting {len(students)}")
191 191 insert_students_into_db(session, students)
192 192  
193 193 # --- update all students
194 194 if args.update_all:
195   - query = select(Student).where(Student.id != '0')
  195 + query = select(Student).where(Student.id != "0")
196 196 all_students = session.execute(query).scalars().all()
197 197 if args.pw is None:
198   - print(f'Resetting password of {len(all_students)} users')
  198 + print(f"Resetting password of {len(all_students)} users")
199 199 for student in all_students:
200 200 student.password = ''
201 201 else:
202   - print(f'Updating password of {len(all_students)} users')
  202 + print(f"Updating password of {len(all_students)} users")
203 203 for student in all_students:
204 204 student.password = ph.hash(args.pw)
205   - print('.', end='', flush=True)
  205 + print(".", end="", flush=True)
206 206 print()
207 207 session.commit()
208 208  
... ... @@ -212,10 +212,10 @@ def main():
212 212 query = select(Student).where(Student.id == student_id)
213 213 student = session.execute(query).scalar_one()
214 214 if args.pw is None:
215   - print(f'Resetting password of user {student_id}')
216   - student.password = ''
  215 + print(f"Resetting password of user {student_id}")
  216 + student.password = ""
217 217 else:
218   - print(f'Updating password of user {student_id}')
  218 + print(f"Updating password of user {student_id}")
219 219 student.password = ph.hash(args.pw)
220 220 session.commit()
221 221  
... ...