3775dd6
From ba3bef9f4643e10444ecbffd36769d274b507f4b Mon Sep 17 00:00:00 2001
3775dd6
From: mprahl <mprahl@redhat.com>
3775dd6
Date: Nov 01 2018 13:38:02 +0000
3775dd6
Subject: Don't assume the context is set on base modules in the 526fb7d445f7_module_buildrequires migration
3775dd6
3775dd6
3775dd6
---
3775dd6
3775dd6
diff --git a/module_build_service/migrations/versions/526fb7d445f7_module_buildrequires.py b/module_build_service/migrations/versions/526fb7d445f7_module_buildrequires.py
3775dd6
index e8192d5..6b23cad 100644
3775dd6
--- a/module_build_service/migrations/versions/526fb7d445f7_module_buildrequires.py
3775dd6
+++ b/module_build_service/migrations/versions/526fb7d445f7_module_buildrequires.py
3775dd6
@@ -80,7 +80,7 @@ def upgrade():
3775dd6
                 .where(mb.c.name == base_module)\
3775dd6
                 .where(mb.c.stream == base_module_dict['stream'])\
3775dd6
                 .where(mb.c.version == base_module_dict['version'])\
3775dd6
-                .where(mb.c.context == base_module_dict['context'])
3775dd6
+                .where(mb.c.context == base_module_dict.get('context'))
3775dd6
             br = connection.execute(select).fetchone()
3775dd6
             if not br:
3775dd6
                 # If the buildrequire isn't in the datbase, then skip it
3775dd6