Seems like a no brainier tbh. Buy in Glasgow whilst you do your masters. If you decide to stay here then you’re one step ahead. If not, then sell up and buy in Edinburgh. With the way the pound/Brexit is going then Edinburgh prices may even be lower then so it’s win win.