Skip to content

Commit

Permalink
fix: duplication bug (frontend fix) + minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
asuworks committed May 25, 2024
1 parent 8a58928 commit ec40a2f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
14 changes: 0 additions & 14 deletions django/library/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,6 @@ def _trying_to_modify_attributes(self, instance, validated_data):
key in validated_data
and getattr(instance, key) != validated_data[key]
):
if key == "affiliations":
instance_affiliations = getattr(instance, "affiliations", None)
incoming_affiliations = validated_data.get("affiliations", None)

if (
instance_affiliations
and instance_affiliations.count() == 0
and not incoming_affiliations
):
logger.debug(
"Skipping update for affiliations because both instance.affiliations and validated_data.affiliations are None and empty list respectively"
)
continue

logger.debug(
f"{key} is not the same! {getattr(instance, key)} != {validated_data[key]}. Contributors can only be updated when they are exclusive to one codebase"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ const { errors, handleSubmit, handleReset, values, setValues } = useForm<Contrib
initialValues,
onSubmit: async () => {
if (!hasName.value) return;
isLoading.value = true;
let contributors = JSON.parse(JSON.stringify(store.releaseContributors));
const newContributor = {
contributor: {
Expand Down Expand Up @@ -255,7 +255,6 @@ const { errors, handleSubmit, handleReset, values, setValues } = useForm<Contrib
await updateContributors(store.identifier, store.versionNumber, contributors);
if (serverErrors.value.length === 0) {
isLoading.value = true;
await store.fetchCodebaseRelease(store.identifier, store.versionNumber);
isLoading.value = false;
setValues(initialValues);
Expand Down

0 comments on commit ec40a2f

Please sign in to comment.