We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a01cfba commit fddb516Copy full SHA for fddb516
api/anubis/views/super/students.py
@@ -164,11 +164,19 @@ def super_students_add(netid: str, name: str):
164
:return:
165
"""
166
167
+ user = User.query.filter(User.netid == netid.strip()).first()
168
+ if user is not None:
169
+ return success_response({
170
+ "status": f"Student already exists {netid}",
171
+ "user": user.data,
172
+ })
173
+
174
user = User(netid=netid.strip(), name=name.strip())
175
db.session.add(user)
176
db.session.commit()
177
178
return success_response({
- "status": f"Added student {netid}"
179
+ "status": f"Added student {netid}",
180
181
})
182
0 commit comments