<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def registration_update_or_create(self):
 """Creates or Updates the registration model with attributes from this instance. Called from the signal """

        if not getattr(self, self.registration_unique_field):
            raise UpdatesOrCreatesRegistrationModelError(
                f'Cannot update or create RegisteredSubject. '
                f'Field value for \'{self.registration_unique_field}\' is None.')

        registration_value = getattr(self, self.registration_unique_field)
        registration_value = self.to_string(registration_value)

        try:
            obj = self.registration_model.objects.get(
                **{self.registered_subject_unique_field: registration_value})
        except self.registration_model.DoesNotExist:
            pass
        else:
            self.registration_raise_on_illegal_value_change(obj)
        registered_subject, created = self.registration_model.objects.update_or_create(
            **{self.registered_subject_unique_field: registration_value},
            defaults=self.registration_options)
        return registered_subject, created