Skip to content

Commit 1330435

Browse files
committed
Fixed misplaced __init__ in model
1 parent 28da12a commit 1330435

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

conditional/blueprints/member_management.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ def edit_uid(uid, username, post_data):
220220

221221
account = ldap_get_member(uid)
222222
active_member = post_data['activeMember']
223-
room_number = post_data['roomNumber']
224-
onfloor_status = post_data['onfloorStatus']
225-
housing_points = post_data['housingPoints']
226223

227224
current_account = ldap_get_member(username)
228225
if ldap_is_eval_director(current_account):
226+
room_number = post_data['roomNumber']
227+
onfloor_status = post_data['onfloorStatus']
228+
housing_points = post_data['housingPoints']
229229
logger.info('backend', action="edit %s room: %s onfloor: %s housepts %s" %
230230
(uid, post_data['roomNumber'], post_data['onfloorStatus'],
231231
post_data['housingPoints']))

conditional/blueprints/spring_evals.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import uuid
2-
import datetime
32
import structlog
43

54
from flask import Blueprint, request
@@ -45,10 +44,7 @@ def get_cm_count(member_id):
4544
SpringEval.active).first()
4645

4746
if spring_entry is None:
48-
spring_entry = SpringEval(uid=uid,
49-
active=True,
50-
date_created=datetime.datetime.now(),
51-
status="Pending")
47+
spring_entry = SpringEval(uid)
5248
db.session.add(spring_entry)
5349
db.session.flush()
5450
db.session.commit()

conditional/models/models.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,13 @@ class SpringEval(db.Model):
248248
name="spring_eval_enum"),
249249
nullable=False)
250250

251-
class InHousingQueue(db.Model):
252-
__tablename__ = 'in_housing_queue'
253-
uid = Column(String(32), primary_key=True)
254-
255251
def __init__(self, uid):
256252
self.uid = uid
257253
self.active = True
258254
self.date_created = datetime.now()
259255
self.status = "Pending"
256+
257+
258+
class InHousingQueue(db.Model):
259+
__tablename__ = 'in_housing_queue'
260+
uid = Column(String(32), primary_key=True)

0 commit comments

Comments
 (0)