Pārlūkot izejas kodu

fix create random alias: new alias not saved

Son NK 5 gadi atpakaļ
vecāks
revīzija
d58ab8c808
2 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 1 0
      app/api/views/new_random_alias.py
  2. 1 1
      server.py

+ 1 - 0
app/api/views/new_random_alias.py

@@ -28,6 +28,7 @@ def new_random_alias():
 
     hostname = request.args.get("hostname")
     gen_email = GenEmail.create_new_gen_email(user_id=user.id)
+    db.session.commit()
 
     if hostname:
         AliasUsedOn.create(gen_email_id=gen_email.id, hostname=hostname)

+ 1 - 1
server.py

@@ -99,7 +99,7 @@ def fake_data():
         password="password",
         activated=True,
         is_admin=True,
-        can_use_custom_domain=True
+        can_use_custom_domain=True,
     )
     db.session.commit()