Skip to content

Commit

Permalink
Release 2023.08.2 (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman authored Aug 17, 2023
2 parents 89a9bfc + a4b9528 commit 6291f6d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 7 additions & 0 deletions data/server.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,30 @@ sub,name,type
03552,McCulley,courtesy_card
42687,Álvarez,courtesy_card
65149,Álvarez,courtesy_card
65149,Álvarez,courtesy_card
89768,Muñoz,courtesy_card
41782,Núñez,courtesy_card
48727,de Merida,courtesy_card
38246,la Peña,courtesy_card
78077,De Bell,courtesy_card
71650,De la Cruz,courtesy_card
71650,De la Cruz,courtesy_card
71650,De la Cruz,courtesy_card
03218,D'Andrea,courtesy_card
51828,Grafton-Herbert,courtesy_card
00596884ca82d6df736892667163ea13ca95404d3f746e516d2443a0c12cc9e199a8bf113142ebe0bbdbbdcecde179fd1ba45c226033d88cec5606b1e29517d6,b654c445c17985721f9899fb310a320fb9f55a1fde191327aaf241aeabd177172e5cef8bf3b8d628213c62d84d4aff8f50e42d5bc849784a079fe84d8fad0de0,courtesy_card
21320c3329d6fe8febd435e93343cd8bb491c14ea21f567e32253be23f625c1b59980e5c904209cbc112d87d26939d7aabbcbcf18eff15c75d9d6dd6f1b232ae,d33f779614d2b3123b5251aebea26cc3c9179d6bd50be9de287b50f6a8c4a34e56e5964ca8e5d09ed6131a5aa3cc09fa64f51af37fefc4e42cde25b797043863,courtesy_card
76abba90ebdb506633af20f40ed50ca2c2446f1916e121fe7d9e59b3e043f0e8b1343abfa4dfc737298ede495197b62a7b8defb53e42d0bdbd8f041874ff10f3,a5a69f778724a4a34c56cf89c7d4d39ba28fd56fffa869a201c435c7cc9d1eb02dcb4c6f33eb22e244914f282fc2aedd43504e0593c50ff88ba4ee21d50bfcfa,courtesy_card
5fdd21510231d67ab623ebf6756aa66701546647fd8662be5b4a17066c357ae6a1934114b99575caf409519edad378e7255bad8a28f3b5b4ea89a1a0e01b6636,d7c3a44353b048fe79bba0eac466f2a9de1e734d29e461bb923ea19c43956fe195641302091e5bfcf8769cf98f9e91552266ad5f72dbff9af3d3f4e126822718,courtesy_card
86ef5506a1959f23b95df072786d9a9a967da80579f975d2130ac18cdac3d6f30c5eb83ad293fa12fbe6c3972be88c28ae354ccb3274ea0b4dae03ecd388e49d,53ae6b57dd4ca31f3c3aa22d6ad7a5da6d8dae3811b8d5405dcaed3fcab182d12a05d334dfe33f87dce2846d9e20ff668745baf50b75fc77b8ba956504082668,courtesy_card
86ef5506a1959f23b95df072786d9a9a967da80579f975d2130ac18cdac3d6f30c5eb83ad293fa12fbe6c3972be88c28ae354ccb3274ea0b4dae03ecd388e49d,53ae6b57dd4ca31f3c3aa22d6ad7a5da6d8dae3811b8d5405dcaed3fcab182d12a05d334dfe33f87dce2846d9e20ff668745baf50b75fc77b8ba956504082668,courtesy_card
86ef5506a1959f23b95df072786d9a9a967da80579f975d2130ac18cdac3d6f30c5eb83ad293fa12fbe6c3972be88c28ae354ccb3274ea0b4dae03ecd388e49d,53ae6b57dd4ca31f3c3aa22d6ad7a5da6d8dae3811b8d5405dcaed3fcab182d12a05d334dfe33f87dce2846d9e20ff668745baf50b75fc77b8ba956504082668,courtesy_card
4b7714a4207e4bbb86e66706833ecb642919f637d7081d73208d63d6a7590fa8ff43a4513b8590050022c19b30f92276215f37f98d284f2ee92b645efeb37ff7,af0b6bd198eb198f51a3f95ff2f27200ec6cd0d1727e941b3761ed2805d9f6062e1d48fe9c85764e791b7e323eab96f48dcc61056778ef204b1cd4fb0633bad8,courtesy_card
4c66c978ae090fa4c02226e84ee7e608fa43c82cba5fce0a4c80b5402df10b80b8f200fd132cc560328e3032d69621879c47369cdbd8dea36454726625b9649c,4fce6a893b07bfa5e2fcb1c575624cfb370eaa909e741981b59ed435f220f0c2ff8d7059cdbd592c5f90854d833e33829529180f08e28fcfb7b78e1eacaa6c82,courtesy_card
6e46a779a5cf7994c6b8d5237520edeaab0cd8b1239c22f26d4630936d2eac43c9a9538b9e862b084fc3d9d4392b765d2a900ec51e0ad16dbec2ad8f64e98508,59ef03cf4015f853953ed727ba2c5a6425434e0dd775dabf1fc728bad7633256647a4ce7f48ccec68c7a820c48c2fd7a0a513df07175085ebbd6fadeb6c6c39a,courtesy_card
3146143c6893a59bb2bf57b2304947a78ad31a45a3c265dd11579008b635e3f98e1c2717b37ab7efe09ed47aacc337397b267270b1754455ea1f05a874c921ca,9bbf4667171f9442aa446185ac90f6fb4241bf48fe832f0cc92d5155caa55b295d30788ab4dec355c56aa21c7e2110765d29fc496c2c868272b1d293f3e91f3d,courtesy_card
c8648b143c08b4a4f2bd50f8df9bda963d061c8a3742c4e47fcbe00d02f11e9a909439450a3627752122919339480c8fa2e9038328453c9e08496a215bff0f60,edf2e1ccc1c4dbdb1bbed076fc73a68ef3c904b737f7ce260f2ccb6d7efc8634f2b9622fe76038bd985d0faaca6f433726dd8c89c48d812b035e854a3302b114,courtesy_card
c8648b143c08b4a4f2bd50f8df9bda963d061c8a3742c4e47fcbe00d02f11e9a909439450a3627752122919339480c8fa2e9038328453c9e08496a215bff0f60,edf2e1ccc1c4dbdb1bbed076fc73a68ef3c904b737f7ce260f2ccb6d7efc8634f2b9622fe76038bd985d0faaca6f433726dd8c89c48d812b035e854a3302b114,courtesy_card
897b4db712e36e23955e3b1950923857379edd8b79fcabe3980f85a5f8b08153d63c9689feadf28bbfa335c243eb57594f9632d62e529b99e87b45e1ae2faf45,fbd4e2bb3a3d5ccc8a21d70a3867f1398bc40bab93e825644c7f0907c57eaec03e26f486c0e05308401cfb28cc90b4fd03a3f8b150c4ec3349f173897ab91c4d,courtesy_card
fc12e93e5ac9fa968e80ac17b85e3386fbfe68598d03a5b240629c47ea04d79231a1a9314afece3f7ac33ca3a341300f1337a4a2659a7d31788da200f24e92f2,0cbcf13358e0caa1441fc7a8c04903be157695f04df26720eec570c09545ef4faaedc3ecf8aa735c008dd66d1c1bf31c967b81d98486dcb7b19a53d56ea75cec,courtesy_card
fc12e93e5ac9fa968e80ac17b85e3386fbfe68598d03a5b240629c47ea04d79231a1a9314afece3f7ac33ca3a341300f1337a4a2659a7d31788da200f24e92f2,0cbcf13358e0caa1441fc7a8c04903be157695f04df26720eec570c09545ef4faaedc3ecf8aa735c008dd66d1c1bf31c967b81d98486dcb7b19a53d56ea75cec,courtesy_card
2 changes: 1 addition & 1 deletion eligibility_server/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "2023.08.1"
__version__ = "2023.08.2"

VERSION = __version__
12 changes: 7 additions & 5 deletions eligibility_server/db/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def import_csv_users(csv_path, remote):
temp_csv.close()


def save_user(sub: str, name: str, types: str):
def save_user(sub: str, name: str, types: list):
"""
Add a user to the database User table
Expand All @@ -122,12 +122,14 @@ def save_user(sub: str, name: str, types: str):
"""

user = User.query.filter_by(sub=sub, name=name).first() or User(sub=sub, name=name)
eligibility_types = [Eligibility.query.filter_by(name=type).first() or Eligibility(name=type) for type in types]
user.types.extend(eligibility_types)
eligibility_types = [Eligibility.query.filter_by(name=t).first() or Eligibility(name=t) for t in types]
new_types = [t for t in eligibility_types if t not in user.types]

db.session.add(user)
db.session.add_all(eligibility_types)
if any(new_types):
user.types.extend(new_types)
db.session.add_all(new_types)

db.session.add(user)
db.session.commit()


Expand Down

0 comments on commit 6291f6d

Please sign in to comment.