from parallels.core.migrated_subscription import HostingDescriptorMigratedSubscription


class CustomPanelMigratedSubscription(HostingDescriptorMigratedSubscription):
    @property
    def is_fake(self):
        """Check if domain is fake - created by technical reasons

        Fake domains may be not existent on source server, and so they should
        not checked.

        :rtype: bool
        """
        return self.hosting_description.is_fake()

    @property
    def mail_source_server_id(self):
        if (
            self.hosting_description is not None and
            self.hosting_description.mail_service is not None and
            self.hosting_description.mail_service.mail_server is not None
        ):
            return self.hosting_description.mail_service.mail_server
        else:
            return self.model.source
